ping

package
v0.0.0-...-e721cab Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(p *Pinger)

func WithNumSeconds

func WithNumSeconds(n uint) Option

func WithPingFrequency

func WithPingFrequency(t time.Duration) Option

func WithPrivileged

func WithPrivileged(privileged bool) Option

type Pinger

type Pinger struct {
	OnRecv func(ps ProbeStats)
	// contains filtered or unexported fields
}

func NewPinger

func NewPinger(probes []Probe, options ...Option) (*Pinger, error)

func (*Pinger) GetProbeStats

func (p *Pinger) GetProbeStats(dst string) ProbeStats

func (*Pinger) Run

func (p *Pinger) Run()

func (*Pinger) StartProbe

func (p *Pinger) StartProbe(probe Probe) error

func (*Pinger) Stats

func (p *Pinger) Stats() map[string]ProbeStats

func (*Pinger) Stop

func (p *Pinger) Stop()

func (*Pinger) StopProbe

func (p *Pinger) StopProbe(dst string) error

type Probe

type Probe struct {
	Src string
	Dst string
}

type ProbeStats

type ProbeStats struct {
	Src  string
	Dst  string
	Loss float64
}

Jump to

Keyboard shortcuts

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