cleanup: remove redundant HTTPClient definition (#643)

This counts as a follow-up cleanup as part of doing
https://github.com/ooni/probe/issues/1885.
This commit is contained in:
Simone Basso
2022-01-03 16:47:54 +01:00
committed by GitHub
parent 273b70bacc
commit 43161a8138
9 changed files with 19 additions and 37 deletions
+2 -8
View File
@@ -29,18 +29,12 @@ var (
ErrEmptyResponse = errors.New("mlablocatev2: empty response")
)
// HTTPClient is anything that looks like an http.Client.
type HTTPClient interface {
// Do behaves like http.Client.Do.
Do(req *http.Request) (*http.Response, error)
}
// Client is a client for v2 of the locate services. Please use the
// NewClient factory to construct a new instance of client, otherwise
// you MUST fill all the fields marked as MANDATORY.
type Client struct {
// HTTPClient is the MANDATORY http client to use
HTTPClient HTTPClient
HTTPClient model.HTTPClient
// Hostname is the MANDATORY hostname of the mlablocate API.
Hostname string
@@ -56,7 +50,7 @@ type Client struct {
}
// NewClient creates a client for v2 of the locate services.
func NewClient(httpClient HTTPClient, logger model.DebugLogger, userAgent string) Client {
func NewClient(httpClient model.HTTPClient, logger model.DebugLogger, userAgent string) Client {
return Client{
HTTPClient: httpClient,
Hostname: "locate.measurementlab.net",