icmp

package
v0.0.0-...-26e86c7 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2022 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PingPayload       = "HELLO-R-U-THERE"
	PingMaxReadBuffer = 1500
)

Variables

View Source
var (
	ErrPingUnknown = errors.New("unknown error when pinging")
)

Functions

This section is empty.

Types

type PingOption

type PingOption func(p *PingRequest)

func PingCount

func PingCount(count int) PingOption

func PingInfinity

func PingInfinity() PingOption

func PingTimeout

func PingTimeout(timeout time.Duration) PingOption

type PingRequest

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

type PingResult

type PingResult struct {
	Source   string
	SourceIP net.IP
	PeerAddr net.Addr
	Type     *ipv4.ICMPType
	Sequence int
	// contains filtered or unexported fields
}

func (*PingResult) Error

func (r *PingResult) Error() error

func (*PingResult) IsOk

func (r *PingResult) IsOk() bool

type Pinging

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

func Ping

func Ping(ctx context.Context, target string, opts ...PingOption) (*Pinging, error)

func (*Pinging) Done

func (p *Pinging) Done() <-chan struct{}

func (*Pinging) Result

func (p *Pinging) Result() <-chan PingResult

Jump to

Keyboard shortcuts

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