sthttp

package
v0.7.5-18 Latest Latest
Warning

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

Go to latest
Published: May 28, 2015 License: GPL-2.0, GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var HTTP_CONFIG_TIMEOUT = time.Duration(15 * time.Second)
View Source
var HTTP_DOWNLOAD_TIMEOUT = time.Duration(15 * time.Minute)
View Source
var HTTP_LATENCY_TIMEOUT = time.Duration(15 * time.Second)
View Source
var SpeedtestConfigUrl = "http://www.speedtest.net/speedtest-config.php"
View Source
var SpeedtestServersUrl = "http://www.speedtest.net/speedtest-servers-static.php"

Functions

func DownloadSpeed

func DownloadSpeed(url string) float64

func GetLatency

func GetLatency(server Server, numRuns int, algotype string) float64

func UploadSpeed

func UploadSpeed(url string, mimetype string, data []byte) float64

Types

type ByDistance

type ByDistance []Server

Sort by Distance

func (ByDistance) Len

func (this ByDistance) Len() int

func (ByDistance) Less

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

func (ByDistance) Swap

func (this ByDistance) Swap(i, j int)

type ByLatency

type ByLatency []Server

Sort by latency

func (ByLatency) Len

func (this ByLatency) Len() int

func (ByLatency) Less

func (this ByLatency) Less(i, j int) bool

func (ByLatency) Swap

func (this ByLatency) Swap(i, j int)

type Config

type Config struct {
	Ip  string
	Lat float64
	Lon float64
	Isp string
}
var CONFIG Config

func GetConfig

func GetConfig() Config

Download config from speedtest.net

type Server

type Server struct {
	Url      string
	Lat      float64
	Lon      float64
	Name     string
	Country  string
	CC       string
	Sponsor  string
	Id       string
	Distance float64
	Latency  float64
}

func GetClosestServers

func GetClosestServers(servers []Server) []Server

func GetFastestServer

func GetFastestServer(numServers int, numRuns int, servers []Server, algotype string) Server

func GetServers

func GetServers() []Server

Jump to

Keyboard shortcuts

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