speedtest

package
v0.0.0-...-04ff805 Latest Latest
Warning

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

Go to latest
Published: May 22, 2022 License: MIT Imports: 15 Imported by: 0

README

This is a fork of github.com/showwin/speedtest-go on 2017-06-26 version No functions changed, but add api.go to make it become a library, such like lower case function name to upper case.

Another reference: github.com/mehrdadrad/mylg

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TestDownloadSpeed

func TestDownloadSpeed() (gspeed.Speed, error)

func TestUploadSpeed

func TestUploadSpeed() (gspeed.Speed, error)

Types

type ByDistance

type ByDistance struct {
	TestServerList
}

ByDistance : For sorting Servers.

func (ByDistance) Less

func (b ByDistance) Less(i, j int) bool

Less : compare the distance. For sorting Servers.

type TestServer

type TestServer struct {
	URL      string `xml:"url,attr"`
	Lat      string `xml:"lat,attr"`
	Lon      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"`
	Distance float64
}

TestServer information

func (TestServer) GetInfo

func (s TestServer) GetInfo() string

Get server information

type TestServerList

type TestServerList struct {
	Servers []TestServer `xml:"servers>server"`
}

TestServerList : List of TestServer

func (TestServerList) Len

func (s TestServerList) Len() int

func (TestServerList) Swap

func (s TestServerList) Swap(i, j int)

Perp : swap i-th and j-th. For sorting Servers.

type User

type User struct {
	IP  string `xml:"ip,attr"`
	Lat string `xml:"lat,attr"`
	Lon string `xml:"lon,attr"`
	Isp string `xml:"isp,attr"`
}

User information

func (User) String

func (u User) String() string

type Users

type Users struct {
	Users []User `xml:"client"`
}

For decode xml

Jump to

Keyboard shortcuts

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