mlablocate

package
v0.9.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 5, 2020 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

Package mlablocate contains a locate.measurementlab.net client.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	HTTPClient *http.Client
	Hostname   string
	Logger     model.Logger
	NewRequest NewRequestFunc
	Scheme     string
	UserAgent  string
}

Client is a locate.measurementlab.net client.

func NewClient

func NewClient(httpClient *http.Client, logger model.Logger, userAgent string) *Client

NewClient creates a new locate.measurementlab.net client.

func (*Client) Query

func (c *Client) Query(ctx context.Context, tool string) (string, error)

Query performs a locate.measurementlab.net query.

type NewRequestFunc

type NewRequestFunc func(ctx context.Context, URL *url.URL) (*http.Request, error)

NewRequestFunc is the function to create a new request.

func NewRequestDefault

func NewRequestDefault() NewRequestFunc

NewRequestDefault return the default implementation of the c.NewRequest for creating a new HTTP request for locate.measurementlab.net.

func NewRequestWithProxy

func NewRequestWithProxy(probeIP string) NewRequestFunc

NewRequestWithProxy returns a new request factory that tells to the locate.measurementlab.net service that we're using a proxy such that the returned host is good for us, not for the proxy.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL