utils

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 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

是否打印测试结果

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)

func (*Bar) SetTotal added in v1.0.2

func (b *Bar) SetTotal(total int)

type CloudflareIPData

type CloudflareIPData struct {
	*PingData

	DownloadSpeed float64
	// contains filtered or unexported fields
}

type DownloadSpeedSet

type DownloadSpeedSet []CloudflareIPData

下载速度排序

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

延迟丢包排序

func (PingDelaySet) FilterDelay

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

延迟条件过滤

func (PingDelaySet) FilterLossRate

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

丢包条件过滤

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)

type Progress added in v1.0.2

type Progress interface {
	Grow(num int, MyStrVal string)
	Done()
	SetTotal(total int)
}

type ProgressNotify added in v1.0.2

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

func NewProgress added in v1.0.2

func NewProgress() *ProgressNotify

func (*ProgressNotify) Done added in v1.0.2

func (p *ProgressNotify) Done()

func (*ProgressNotify) Grow added in v1.0.2

func (p *ProgressNotify) Grow(num int, MyStrVal string)

func (*ProgressNotify) SetTotal added in v1.0.2

func (p *ProgressNotify) SetTotal(total int)

Jump to

Keyboard shortcuts

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