ping

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2023 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionsAPI

type ActionsAPI interface {
	Ping(ctx context.Context, localVarOptionals *state.ActionsApiPingOpts) (state.PingStatus, *http.Response, error)
}

type Option

type Option func(*Ping) error

Option applies a ping command argument

func Count

func Count(count int) Option

Count sets the number of pings to be sent.

func DestinationHostNameA

func DestinationHostNameA(hostname string) Option

DestinationHostNameA sets the destination hostname that shall be translated to an IPv4 address (DNS A record)

func DestinationHostNameAAAA

func DestinationHostNameAAAA(hostname string) Option

DestinationHostNameAAAA sets the destination hostname that shall be translated to an IPv6 address (DNS AAAA record)

func DestinationIP

func DestinationIP(ipAddr net.IP) Option

DestinationIP sets the ping destination IP address. Override destination host name settings, if any.

func InstanceName

func InstanceName(instanceName string) Option

InstanceName sets the routing instance name to run the ping command.

func Interval

func Interval(interval time.Duration) Option

Interval sets the interval between two pings. The accepted interval range is between 1ms and 10 seconds.

func Size added in v1.1.0

func Size(size int) Option

Size sets the ping packet size in bytes. The size must be between 8 and 32768 bytes.

func SourceIP

func SourceIP(ipAddress net.IP) Option

SourceIP specifies the source IP address

func SourceInterface

func SourceInterface(name string) Option

SourceInterface sets the ping source interface name. Source interface and source IP are mutual exclusive!

func TTL added in v1.1.0

func TTL(ttl int) Option

TTL sets the IP packet time-to-live value.

type Ping

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

Ping contains all arguments to ping a destination IP address or hostname

func NewPing

func NewPing(options ...Option) (*Ping, error)

NewPing creates a new ping command

func (*Ping) Count

func (p *Ping) Count() int

func (*Ping) DestinationHostNameA

func (p *Ping) DestinationHostNameA() string

func (*Ping) DestinationHostNameAAAA

func (p *Ping) DestinationHostNameAAAA() string

func (*Ping) DestinationIP

func (p *Ping) DestinationIP() net.IP

func (*Ping) Interval

func (p *Ping) Interval() time.Duration

func (*Ping) Size added in v1.1.0

func (p *Ping) Size() int

func (*Ping) SourceIP

func (p *Ping) SourceIP() net.IP

func (*Ping) SourceInterface

func (p *Ping) SourceInterface() string

func (*Ping) TTL added in v1.1.0

func (p *Ping) TTL() int

type Service

type Service interface {
	// Run executes the given ping.
	Run(rbfs.RbfsContext, *Ping) (state.PingStatus, error)

	// RunAll runs all given pings in parallel go routines.
	RunAll(rbfs.RbfsContext, ...*Ping) ([]state.PingStatus, error)
}

Service pings given destinations.

func NewPingService

func NewPingService(client *http.Client) Service

NewPingService creates a new ping defaultService.

Jump to

Keyboard shortcuts

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