Documentation ¶
Index ¶
- Variables
- func ConvertToString(data []CloudflareIPData) [][]string
- func ExportCSV(data []CloudflareIPData, filePath string)
- func IPStrToIPAddr(ipStr string) *net.IPAddr
- func IsIPv4(ip string) bool
- func LoadIPRanges(ipList []string, testAll bool) []*net.IPAddr
- type CloudflareIPData
- type DownloadSpeedSet
- type IPRanges
- type PingData
- type PingDelaySet
- func (s PingDelaySet) FilterDelay(globalConfig *entity.TestOptions) (data PingDelaySet)
- func (s PingDelaySet) FilterIPBan(globalConfig *entity.TestOptions) (data PingDelaySet)
- func (s PingDelaySet) FilterLossRate(globalConfig *entity.TestOptions) (data PingDelaySet)
- func (s PingDelaySet) FilterWantedISOIP(globalConfig *entity.TestOptions) (data PingDelaySet)
- func (s PingDelaySet) Len() int
- func (s PingDelaySet) Less(i, j int) bool
- func (s PingDelaySet) Swap(i, j int)
Constants ¶
This section is empty.
Variables ¶
View Source
var (
PrintNum = 30
)
Functions ¶
func ConvertToString ¶
func ConvertToString(data []CloudflareIPData) [][]string
ConvertToString
@Description: 结构体转化为字符串 @param data @return [][]string
func ExportCSV ¶
func ExportCSV(data []CloudflareIPData, filePath string)
ExportCSV
@Description: 导出结果为csv文件 @param data
func IPStrToIPAddr ¶
Types ¶
type CloudflareIPData ¶
type CloudflareIPData struct { *PingData DownloadSpeed float64 `json:"downloadSpeed"` // contains filtered or unexported fields }
func (*CloudflareIPData) GetDataStrList ¶
func (cf *CloudflareIPData) GetDataStrList() []string
GetDataStrList
@Description: 获取结果字符串列表 @receiver cf @return []string
func (*CloudflareIPData) GetLossRate ¶
func (cf *CloudflareIPData) GetLossRate() float32
GetLossRate
@Description: 计算丢包率 @receiver cf @return float32
type DownloadSpeedSet ¶
type DownloadSpeedSet []CloudflareIPData
DownloadSpeedSet 下载速度排序
func (DownloadSpeedSet) Len ¶
func (s DownloadSpeedSet) Len() int
Len
@Description: 实现sort接口 @receiver s @return int
func (DownloadSpeedSet) Less ¶
func (s DownloadSpeedSet) Less(i, j int) bool
func (DownloadSpeedSet) PrettyPrint ¶
func (s DownloadSpeedSet) PrettyPrint()
PrettyPrint
@Description: 格式化打印输出 @receiver s
func (DownloadSpeedSet) Swap ¶
func (s DownloadSpeedSet) Swap(i, j int)
type PingDelaySet ¶
type PingDelaySet []CloudflareIPData
PingDelaySet 延迟丢包排序
func (PingDelaySet) FilterDelay ¶
func (s PingDelaySet) FilterDelay(globalConfig *entity.TestOptions) (data PingDelaySet)
FilterDelay
@Description: 延迟条件过滤 @receiver s @param globalConfig @return data
func (PingDelaySet) FilterIPBan ¶
func (s PingDelaySet) FilterIPBan(globalConfig *entity.TestOptions) (data PingDelaySet)
FilterIPBan
@Description: 墙内ipban 过滤 @receiver s @param globalConfig @return data
func (PingDelaySet) FilterLossRate ¶
func (s PingDelaySet) FilterLossRate(globalConfig *entity.TestOptions) (data PingDelaySet)
FilterLossRate
@Description: 丢包条件过滤 @receiver s @param globalConfig @return data
func (PingDelaySet) FilterWantedISOIP ¶
func (s PingDelaySet) FilterWantedISOIP(globalConfig *entity.TestOptions) (data PingDelaySet)
func (PingDelaySet) Less ¶
func (s PingDelaySet) Less(i, j int) bool
func (PingDelaySet) Swap ¶
func (s PingDelaySet) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.