Documentation ¶
Overview ¶
Package speedtest contains methods for performing internet speed tests using speedtest.net.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrStatus = errors.New("unexpected status code")
ErrStatus is the error given when an HTTP call to speedtest.net returns an error status code.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { IP string `xml:"ip,attr"` Latitude string `xml:"lat,attr"` Longitude string `xml:"lon,attr"` ISP string `xml:"isp,attr"` }
The Client type contains information about the client performing a speed test.
type GetClientsResponse ¶
type GetClientsResponse struct {
Clients []Client `xml:"client"`
}
GetClientsResponse is the response DTO used when getting the speed test client info.
type GetServersResponse ¶
type GetServersResponse struct {
Servers []Server `xml:"servers>server"`
}
GetServersResponse is the response DTO used when getting test server info.
type Server ¶
type Server struct { URL string `xml:"url,attr"` Latitude string `xml:"lat,attr"` Longitude string `xml:"lon,attr"` Name string `xml:"name,attr"` Country string `xml:"country,attr"` Sponsor string `xml:"sponsor,attr"` ID string `xml:"id,attr"` URL2 string `xml:"url2,attr"` Host string `xml:"host,attr"` }
The Server type contains information about a server that can be used to perform a speed test.
type Tester ¶
type Tester struct {
// contains filtered or unexported fields
}
The Tester type is responsible for performing internet speed tests.
func New ¶
func New() *Tester
New returns a new instance of the Tester type that can perform a speed test.