Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DefaultICMPInterface ICMP = new(DefaultICMP) DefaultIsDownCheck = IsDownCheck DefaultIsUpCheck = IsUpCheck DefaultTimeout = time.Millisecond * 50 DefaultInterval = time.Millisecond * 100 )
Functions ¶
func IsDownCheck ¶
func IsDownCheck(reply icmp.ICMPReturn) bool
func IsUpCheck ¶
func IsUpCheck(reply icmp.ICMPReturn) bool
Types ¶
type DefaultICMP ¶
type DefaultICMP struct{}
type ReplyChecker ¶
type ReplyChecker func(icmp.ICMPReturn) bool
type Watcher ¶
type Watcher struct {
// contains filtered or unexported fields
}
func NewWatcher ¶
func NewWatcher(target net.IP, options ...WatcherOption) Watcher
func (Watcher) RunWithCheck ¶
func (w Watcher) RunWithCheck(check ReplyChecker) time.Time
type WatcherOption ¶
type WatcherOption func(*Watcher)
func WithInterval ¶
func WithInterval(interval time.Duration) WatcherOption
func WithIsDownCheck ¶
func WithIsDownCheck(check ReplyChecker) WatcherOption
func WithIsUpCheck ¶
func WithIsUpCheck(check ReplyChecker) WatcherOption
func WithTimeout ¶
func WithTimeout(timeout time.Duration) WatcherOption
func WithVerbosity ¶
func WithVerbosity(verbose bool) WatcherOption
Click to show internal directories.
Click to hide internal directories.