speed

package
v1.2.8 Latest Latest
Warning

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

Go to latest
Published: Sep 29, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UA = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CFSpeedTest

type CFSpeedTest struct {
	LocationMap       map[string]Location
	SpeedTestTimeout  int
	IpFile            string
	OutFile           string
	DefaultPort       int
	MaxThread         int
	SpeedTestThread   int
	DelayTestURL      string
	SpeedTestURL      string
	TestWebSocket     bool
	MaxSpeedTestCount int
	MaxDelayCount     int
	MinSpeed          float64
	EnableTLS         bool
	Shuffle           bool
	VerboseMode       bool
	FilterIATA        string
	FilterIATASet     map[string]*struct{}
	DelayTestType     int
}

func (*CFSpeedTest) GetDelayTestURL added in v1.2.5

func (st *CFSpeedTest) GetDelayTestURL() string

func (*CFSpeedTest) GetLocationMap

func (st *CFSpeedTest) GetLocationMap() map[string]Location

func (*CFSpeedTest) Output

func (st *CFSpeedTest) Output(results []*SpeedTestResult)

func (*CFSpeedTest) PreSetArgs added in v1.2.3

func (st *CFSpeedTest) PreSetArgs()

func (*CFSpeedTest) Run

func (st *CFSpeedTest) Run()

func (*CFSpeedTest) SetFromEnv added in v1.2.2

func (st *CFSpeedTest) SetFromEnv()

func (*CFSpeedTest) TestDelay

func (st *CFSpeedTest) TestDelay(ips []IpPair) chan Result

func (*CFSpeedTest) TestDelayOnce added in v1.2.2

func (st *CFSpeedTest) TestDelayOnce(ipPair IpPair) (*Result, error)

func (*CFSpeedTest) TestDelayUseH1 added in v1.2.5

func (st *CFSpeedTest) TestDelayUseH1(ipPair IpPair) (*DelayResult, error)

func (*CFSpeedTest) TestDelayUseH3 added in v1.2.5

func (st *CFSpeedTest) TestDelayUseH3(ipPair IpPair) (*DelayResult, error)

func (*CFSpeedTest) TestDownload

func (st *CFSpeedTest) TestDownload(resultChan chan Result) []*SpeedTestResult

func (*CFSpeedTest) TestTCP added in v1.2.5

func (st *CFSpeedTest) TestTCP(ipPair IpPair) (*Result, error)

func (*CFSpeedTest) TestWebSocketDelay added in v1.2.2

func (st *CFSpeedTest) TestWebSocketDelay(ipPair IpPair) (bool, error)

type DelayResult added in v1.2.5

type DelayResult struct {
	// contains filtered or unexported fields
}

type IpPair

type IpPair struct {
	// contains filtered or unexported fields
}

func (*IpPair) String

func (ip *IpPair) String() string

type Location

type Location struct {
	Iata   string  `json:"iata"`
	Lat    float64 `json:"lat"`
	Lon    float64 `json:"lon"`
	Cca2   string  `json:"cca2"`
	Region string  `json:"region"`
	City   string  `json:"city"`
}

type Result

type Result struct {
	// contains filtered or unexported fields
}

type SpeedTestResult

type SpeedTestResult struct {
	Result
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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