ping

package
v0.2.98 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2024 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PingExec

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

func NewPingExec

func NewPingExec() *PingExec

func (*PingExec) GetDir

func (instance *PingExec) GetDir() string

func (*PingExec) Ping

func (instance *PingExec) Ping(target string, exitCallback func(row *PingResponseRow) bool) (*PingResponse, error)

func (*PingExec) PingCount

func (instance *PingExec) PingCount(target string, n int) (*PingResponse, error)

func (*PingExec) PingOnce

func (instance *PingExec) PingOnce(target string) (*PingResponse, error)

func (*PingExec) PingOut

func (instance *PingExec) PingOut(target string, out io.Writer) (*executor.ConsoleProgramSession, error)

func (*PingExec) SetDir

func (instance *PingExec) SetDir(dir string)

type PingResponse

type PingResponse struct {
	Header     string                  `json:"header"`
	Body       []string                `json:"body"`
	Footer     string                  `json:"footer"`
	Rows       []*PingResponseRow      `json:"rows"`
	Statistics *PingResponseStatistics `json:"statistics"`
}

func (*PingResponse) String

func (instance *PingResponse) String() string

type PingResponseRow

type PingResponseRow struct {
	Bytes  int     `json:"bytes"`
	TimeMs float32 `json:"time_ms"`
	Ttl    string  `json:"ttl"`
	Source string  `json:"source"`
}

func ParsePingRow

func ParsePingRow(row string) *PingResponseRow

func (*PingResponseRow) String

func (instance *PingResponseRow) String() string

type PingResponseStatistics

type PingResponseStatistics struct {
	PacketTransmitted int     `json:"packet_transmitted"`
	PacketReceived    int     `json:"packet_received"`
	PacketLoss        float32 `json:"packet_loss"`
	Min               float32 `json:"min"`
	Max               float32 `json:"max"`
	Avg               float32 `json:"avg"`
}

func (*PingResponseStatistics) String

func (instance *PingResponseStatistics) String() string

Jump to

Keyboard shortcuts

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