Documentation ¶
Index ¶
Constants ¶
Variables ¶
View Source
var DefaultConfig = Config{ Timeout: DefaultTimeout, PingNum: DefaultNumPings, Privileged: Privileged, BackoffLimit: DefaultBackoffLimit, Cping: DefaultCPing, DelayRetry: DefaultDelayRetry, }
View Source
var ErrInvalidIP = errors.New("ip is not ipv4")
Functions ¶
func WithConfig ¶
func WithNumPings ¶
func WithPrivileged ¶
Types ¶
type Config ¶
type Config struct { // Timeout socket read/write timeout Timeout int // DefaultBackoffLimit is the number of time to read before the read op // is considered as a failed read BackoffLimit int // PingNum is the number of ICMP echo request to send PingNum int // Cping number of concurrent ping Cping int // Privileged is set to true, then raw socket will be used as the underlying socket type // otherwise, then dgram socket will be used as the underlying socket type Privileged bool // DelayRetry tells how much time(milliseconds) to wait before // retrying a read icmp message op DelayRetry int }
Click to show internal directories.
Click to hide internal directories.