From 375932ce51ae4e4055bf0c41f073751b90970e07 Mon Sep 17 00:00:00 2001 From: Taras Madan Date: Thu, 9 May 2024 12:50:02 +0200 Subject: dashboard/dashapi/dashapi.go: delete RequestMocker --- dashboard/dashapi/dashapi.go | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) diff --git a/dashboard/dashapi/dashapi.go b/dashboard/dashapi/dashapi.go index e4d2fb234..e141d8832 100644 --- a/dashboard/dashapi/dashapi.go +++ b/dashboard/dashapi/dashapi.go @@ -21,17 +21,12 @@ import ( ) type Dashboard struct { - Client string - Addr string - Key string - ctor RequestCtor - doer RequestDoer - logger RequestLogger - // Yes, we have the ability to set custom constructor, doer and logger, but - // there are also cases when we just want to mock the whole request processing. - // Implementing that on top of http.Request/http.Response would complicate the - // code too much. - mocker RequestMocker + Client string + Addr string + Key string + ctor RequestCtor + doer RequestDoer + logger RequestLogger errorHandler func(error) } @@ -43,7 +38,6 @@ type ( RequestCtor func(method, url string, body io.Reader) (*http.Request, error) RequestDoer func(req *http.Request) (*http.Response, error) RequestLogger func(msg string, args ...interface{}) - RequestMocker func(method string, req, resp interface{}) error ) // key == "" indicates that the ambient GCE service account authority @@ -938,9 +932,6 @@ func (dash *Dashboard) Query(method string, req, reply interface{}) error { if dash.logger != nil { dash.logger("API(%v): %#v", method, req) } - if dash.mocker != nil { - return dash.mocker(method, req, reply) - } err := dash.queryImpl(method, req, reply) if err != nil { if dash.logger != nil { -- cgit mrf-deployment