mlablocate

package
v0.0.0-...-bd88772 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2021 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
	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) (Result, error)

Query performs a locate.measurementlab.net query.

type Result

type Result struct {
	City    string   `json:"city"`
	Country string   `json:"country"`
	IP      []string `json:"ip"`
	FQDN    string   `json:"fqdn"`
	Site    string   `json:"site"`
}

Result is a result of a query to locate.measurementlab.net.

Jump to

Keyboard shortcuts

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