ping

package
v0.0.0-...-1cb3af8 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2017 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MyPing

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

func NewMyPing

func NewMyPing(config *viper.Viper) (*MyPing, error)

func (*MyPing) Do

func (p *MyPing) Do(resultChan chan<- interface{})

pingResult 的获取方式如下:

available: 连续 ping retry 次,只要有一次能 ping 通,就认为 ping 的通
err:       记录每个 ping 失败的原因
delay:     只有 ping 通的延迟参与到最终 delay 计算,单位 秒,0 表示都 ping 不通
loss:      ping 不通 除以 retry,值小于1,保留4位小数

func (*MyPing) Ping

func (p *MyPing) Ping() (delay float64, err error)

Jump to

Keyboard shortcuts

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