Documentation
¶
Overview ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNotEnoughLines = errors.New("not enough lines") ErrHeaderMismatch = errors.New("header mismatch") ErrUnknownHost = errors.New("unkown host") ErrUnrecognizedLine = errors.New("unrecognized ping reply line") ErrMalformedStatsHeader = errors.New("malformed stats header") ErrMalformedStatsLine1 = errors.New("malformed stats line 1") ErrMalformedStatsLine2 = errors.New("malformed stats line 2") )
Functions ¶
This section is empty.
Types ¶
type ConversionError ¶
func (ConversionError) Error ¶
func (ce ConversionError) Error() string
type PingOutput ¶
type PingOutput struct { Host string ResolvedIPAddress string PayloadSize uint PayloadActualSize uint Replies []PingReply Stats PingStatistics }
PingOutput contains the whole ping operation output.
func Parse ¶
func Parse(s string) (*PingOutput, error)
Parse will parse the specified ping output and return all the information in a a PingOutput object.
type PingReply ¶
type PingReply struct { Size uint FromAddress string SequenceNumber uint TTL uint Time time.Duration Error string Duplicate bool }
PingReply contains an individual ping reply line.
type PingStatistics ¶
type PingStatistics struct { IPAddress string PacketsTransmitted uint PacketsReceived uint Errors uint PacketLossPercent float32 Time time.Duration RoundTripMin time.Duration RoundTripAverage time.Duration RoundTripMax time.Duration RoundTripDeviation time.Duration Warning string }
PingStatistics contains the statistics of the whole ping operation.
Click to show internal directories.
Click to hide internal directories.