Documentation ¶
Overview ¶
Package api loads configuration data from api.fast.com.
Index ¶
Constants ¶
View Source
const ( // DefaultToken is a known api.fast.com token, used by Load if no other token // is specified. DefaultToken = "YXNkZmFzZGxmbnNkYWZoYXNkZmhrYWxm" // DefaultUserAgent is used by Load if no other user agent is specified. DefaultUserAgent = "fast/0.1 (" + runtime.GOOS + "; " + runtime.GOARCH + ")" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { // ASN is the ISP's Autonomous System Number. // // For example, CenturyLink's ASN is 209. // https://whois.arin.net/rest/asn/AS209 ASN string `json:"asn"` // ISP is the name of the ISP. ISP string `json:"isp"` Location Location `json:"location"` // IP is the client's public IP address. IP net.IP `json:"ip"` }
Client contains information on the client requesting the configuration.
type Config ¶
type Config struct { // Client contains information on the client requesting the configuration. Client Client `json:"client"` // Targets contains Targets []Target `json:"targets"` }
Config is an api.fast.com configuration.
type Option ¶
type Option func(*loader)
Option is a function that modifies the loading of an API configuration.
func WithClient ¶
WithClient sets the Client used to load the configuration.
func WithUserAgent ¶
WithUserAgent sets the user agent to use while loading the configuration.
type Target ¶
type Target struct { // URL is file's URL. URL string `json:"url"` // Location currently contains (Netflix, Open Connect). Location Location `json:"location"` // Name is currently set to the same thing as URL. Name string `json:"name"` }
Target describes a particular file used to measure download speed.
Click to show internal directories.
Click to hide internal directories.