goping

package
v0.1.0-alpha-2 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2016 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pinger

type Pinger struct {
	Timeout        float32      //The timeout, in secs,  to wait for a EchoReply
	Interval       float32      //The time to wait between pings on this host
	Iterations     int          //The number of messages to be sent to the target
	PacketSize     int          //The size of the Packet to be sent
	PongChannel    chan Pong    //A pointer to a channel of Pong objects. May be nil
	SummaryChannel chan Summary //A pointer to a channel of Summary objects. May be nil
	// contains filtered or unexported fields
}

The object that will store global ping parameters and perform the ping operations This should be invoked before adding ping requests

func (*Pinger) Ping

func (p *Pinger) Ping(r Request) (*Pong, error)

Synchronous Ping

type Pong

type Pong struct {
	Request *Request  //THe original request object
	When    time.Time //The time the reply was received
	Err     error     // If eny error happened, this goes here, including timeout
	Rtt     float64   // THe elapsed time, in miliseconds, spending from throwing the packet and receiving the packet

	Peer net.Addr //THe peer that respond to the pong request
	Size int      //THe size of the packet
	Data []byte   //The bytes received from the network
}

Represents a Ping response

type Request

type Request struct {
	//External variables
	To       string            //THe ip or FQDN to use as the icmp target
	UserData map[string]string //A map to hold user data
	// contains filtered or unexported fields
}

Represents a Ping Request

type Summary

type Summary struct {
	Request *Request //The pointer for the Request object. So the user can reference that
	Replies []Pong   //A slice of EchoReply. The size will be the iterator Position
}

Summarization of all Responses from a Request

Jump to

Keyboard shortcuts

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