Versions in this module Expand all Collapse all v0 v0.0.3 Feb 5, 2023 v0.0.2 Feb 5, 2023 Changes in this version + var Locations = map[string]Location + func PrintCityList() + func Version() string + type ByDistance struct + func (b ByDistance) Less(i, j int) bool + type HTTPClient interface + Do func(req *http.Request) (*http.Response, error) + type Location struct + CC string + Lat float64 + Lon float64 + type Option func(*Speedtest) + func WithDoer(doer HTTPClient) Option + type PayloadType int + const JSONPayload + const XMLPayload + type RepeatReader struct + ContentLength int64 + func NewRepeatReader(size int) *RepeatReader + func (r *RepeatReader) Read(b []byte) (n int, err error) + type Server struct + Country string + DLSpeed float64 + Distance float64 + Host string + ID string + Lat string + Latency time.Duration + Lon string + Name string + Sponsor string + ULSpeed float64 + URL string + URL2 string + func CustomServer(s string) (*Server, error) + func (s *Server) DownloadTest(savingMode bool) error + func (s *Server) DownloadTestContext(ctx context.Context, savingMode bool) error + func (s *Server) PingTest() error + func (s *Server) PingTestContext(ctx context.Context) error + func (s *Server) String() string + func (s *Server) UploadTest(savingMode bool) error + func (s *Server) UploadTestContext(ctx context.Context, savingMode bool) error + func (s Server) CheckResultValid() bool + type ServerList struct + Servers []*Server + func (l ServerList) String() string + type Servers []*Server + func FetchServerListContext(ctx context.Context, user *User) (Servers, error) + func FetchServers(user *User) (Servers, error) + func (l Servers) FindServer(serverID []int) (Servers, error) + func (l Servers) String() string + func (svrs Servers) Len() int + func (svrs Servers) Swap(i, j int) + type Speedtest struct + func New(opts ...Option) *Speedtest + func (client *Speedtest) FetchServerListContext(ctx context.Context, user *User) (Servers, error) + func (client *Speedtest) FetchServers(user *User) (Servers, error) + func (client *Speedtest) FetchUserInfo() (*User, error) + func (client *Speedtest) FetchUserInfoContext(ctx context.Context) (*User, error) + type User struct + IP string + Isp string + Lat string + Lon string + VLat string + VLoc string + VLon string + func FetchUserInfo() (*User, error) + func FetchUserInfoContext(ctx context.Context) (*User, error) + func (u *User) ParseAndSetLocation(coordinateStr string) error + func (u *User) SetLocation(locationName string, latitude float64, longitude float64) + func (u *User) SetLocationByCity(locationLabel string) (err error) + func (u *User) String() string + type Users struct + Users []User