Documentation ¶
Index ¶
- func Distance(lat1 float64, lon1 float64, lat2 float64, lon2 float64) float64
- type Client
- type Result
- type Server
- func (s *Server) DownLoadTest(ctx context.Context, c *http.Client, concurrency, downloadSize int, ...) (chan Result, error)
- func (s *Server) GetPingLatency(ctx context.Context, c *http.Client) error
- func (s *Server) String() string
- func (s *Server) UpLoadTest(ctx context.Context, c *http.Client, concurrency, size int, ...) (chan Result, error)
- type ServerList
- type User
- type Users
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CurrentUser ¶
func (*Client) FetchServerList ¶
func (c *Client) FetchServerList(ctx context.Context) (ServerList, error)
func (*Client) GetInnerClient ¶
type Server ¶
type Server struct { URL string `xml:"url,attr" json:"url"` URL2 string `xml:"url2,attr" json:"url_2"` Lat string `xml:"lat,attr" json:"lat"` Lon string `xml:"lon,attr" json:"lon"` Name string `xml:"name,attr" json:"name"` Country string `xml:"country,attr" json:"country"` Sponsor string `xml:"sponsor,attr" json:"sponsor"` ID string `xml:"id,attr" json:"id"` Host string `xml:"host,attr" json:"host"` Distance float64 `json:"distance"` Latency time.Duration `json:"latency"` DLSpeed float64 `json:"dl_speed"` // Mbps ULSpeed float64 `json:"ul_speed"` // Mbps // contains filtered or unexported fields }
func (*Server) DownLoadTest ¶
func (*Server) GetPingLatency ¶
type ServerList ¶
type ServerList []*Server
func (ServerList) Len ¶
func (svrs ServerList) Len() int
Len finds length of servers. For sorting servers.
func (ServerList) Less ¶
func (svrs ServerList) Less(i, j int) bool
Swap swaps i-th and j-th. For sorting servers.
func (ServerList) Swap ¶
func (svrs ServerList) Swap(i, j int)
Swap swaps i-th and j-th. For sorting servers.
Click to show internal directories.
Click to hide internal directories.