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:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user