utils

package
v0.0.0-...-6e02b80 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	InputMaxDelay    = maxDelay
	InputMinDelay    = minDelay
	InputMaxLossRate = maxLossRate
	Output           = defaultOutput
	PrintNum         = 10
)

Functions

func ExportCsv

func ExportCsv(data []CloudflareIPData)

func NoPrintResult

func NoPrintResult() bool

Check if to print test results

Types

type Bar

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

func NewBar

func NewBar(count int, MyStrStart, MyStrEnd string) *Bar

func (*Bar) Done

func (b *Bar) Done()

func (*Bar) Grow

func (b *Bar) Grow(num int, MyStrVal string)

type CloudflareIPData

type CloudflareIPData struct {
	*PingData

	DownloadSpeed float64
	// contains filtered or unexported fields
}

type DownloadSpeedSet

type DownloadSpeedSet []CloudflareIPData

Download speed sorting

func (DownloadSpeedSet) Len

func (s DownloadSpeedSet) Len() int

func (DownloadSpeedSet) Less

func (s DownloadSpeedSet) Less(i, j int) bool

func (DownloadSpeedSet) Print

func (s DownloadSpeedSet) Print()

func (DownloadSpeedSet) Swap

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

type PingData

type PingData struct {
	IP       *net.IPAddr
	Sended   int
	Received int
	Delay    time.Duration
}

type PingDelaySet

type PingDelaySet []CloudflareIPData

Delay and packet loss sorting

func (PingDelaySet) FilterDelay

func (s PingDelaySet) FilterDelay() (data PingDelaySet)

Delay condition filtering

func (PingDelaySet) FilterLossRate

func (s PingDelaySet) FilterLossRate() (data PingDelaySet)

Packet loss condition filtering

func (PingDelaySet) Len

func (s PingDelaySet) Len() int

func (PingDelaySet) Less

func (s PingDelaySet) Less(i, j int) bool

func (PingDelaySet) Swap

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

Jump to

Keyboard shortcuts

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