diff options
| author | Taras Madan <tarasmadan@google.com> | 2024-05-09 12:50:02 +0200 |
|---|---|---|
| committer | Taras Madan <tarasmadan@google.com> | 2024-05-10 08:47:29 +0000 |
| commit | 375932ce51ae4e4055bf0c41f073751b90970e07 (patch) | |
| tree | b5bb3ab5f67e13709cd180ef8d365353f43e92ab | |
| parent | de979bc20b2b73242b7d6fbbdf614a8cb4c574f4 (diff) | |
dashboard/dashapi/dashapi.go: delete RequestMocker
| -rw-r--r-- | dashboard/dashapi/dashapi.go | 21 |
1 files 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 { |
