Documentation ¶
Index ¶
- type MockSpeedtest
- type Number
- type Speedtest
- type SpeedtestCLI
- type SpeedtestGo
- type SpeedtestResult
- func (r *SpeedtestResult) ClientIp() string
- func (r *SpeedtestResult) ClientIsp() string
- func (r *SpeedtestResult) DataUsed() float64
- func (r *SpeedtestResult) DownloadSpeed() float64
- func (r *SpeedtestResult) JitterLatency() float64
- func (r *SpeedtestResult) Ping() float64
- func (r *SpeedtestResult) Success() bool
- func (r *SpeedtestResult) UploadSpeed() float64
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockSpeedtest ¶
type MockSpeedtest struct { Callback func() Fail bool Result *SpeedtestResult }
func (*MockSpeedtest) Speedtest ¶
func (s *MockSpeedtest) Speedtest() *SpeedtestResult
type Speedtest ¶
type Speedtest interface {
Speedtest() *SpeedtestResult
}
type SpeedtestCLI ¶
type SpeedtestCLI struct {
// contains filtered or unexported fields
}
func NewSpeedtestCLI ¶
func NewSpeedtestCLI(executable string) (*SpeedtestCLI, error)
Create SpeedtestCLI, fails when it can't find the speedtest-cli binary Arguments:
executable: name or full path to speedtest-cli binary
func (*SpeedtestCLI) Path ¶
func (s *SpeedtestCLI) Path() string
Get path of the speedtest-cli binary
func (*SpeedtestCLI) Speedtest ¶
func (s *SpeedtestCLI) Speedtest() *SpeedtestResult
Execute the speedtest-cli binary and parse the result
type SpeedtestGo ¶
type SpeedtestGo struct { }
func (*SpeedtestGo) Speedtest ¶
func (s *SpeedtestGo) Speedtest() *SpeedtestResult
Use the speedtest-go api to run a speedtest and parse the result
type SpeedtestResult ¶
type SpeedtestResult struct {
// contains filtered or unexported fields
}
func NewFailedSpeedtestResult ¶
func NewFailedSpeedtestResult() *SpeedtestResult
Create a new SpeedtestResult for a failed speedtest.
func NewSpeedtestResult ¶
func NewSpeedtestResult(jitterLatency float64, ping float64, downloadSpeed float64, uploadSpeed float64, dataUsed float64, clientIsp string, clientIp string) *SpeedtestResult
Create a new SpeedtestResult from a successfull speedrun
func (*SpeedtestResult) ClientIp ¶
func (r *SpeedtestResult) ClientIp() string
Public IP of the client/connection
func (*SpeedtestResult) ClientIsp ¶
func (r *SpeedtestResult) ClientIsp() string
ISP name of the client/connection
func (*SpeedtestResult) DataUsed ¶
func (r *SpeedtestResult) DataUsed() float64
Data usage of speedtest in MB
func (*SpeedtestResult) DownloadSpeed ¶
func (r *SpeedtestResult) DownloadSpeed() float64
Download speed im Mbps
func (*SpeedtestResult) JitterLatency ¶
func (r *SpeedtestResult) JitterLatency() float64
Jitter latency of ping in ms
func (*SpeedtestResult) Success ¶
func (r *SpeedtestResult) Success() bool
Indicates if the test was successfull
func (*SpeedtestResult) UploadSpeed ¶
func (r *SpeedtestResult) UploadSpeed() float64
Upload speed in Mbps
Click to show internal directories.
Click to hide internal directories.