goping

package
v0.1.2-alpha Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPoolSize

func GetPoolSize() int

func RunCh

func RunCh(targets []*Target, s Settings) (chreply chan *EchoReply)

func RunFn

func RunFn(targets []*Target, s Settings, fnEchoReply func(*EchoReply))

func SetPoolSize

func SetPoolSize(sz int)

Types

type EchoReply

type EchoReply struct {
	Cycle  int
	Target *Target
	Rtt    float64
	Bytes  int
	Peer   net.IP
	Seq    int
	TTL    int
	Err    error
}

64 bytes from 200.221.2.45: icmp_seq=2 ttl=53 time=25.291 ms

func (EchoReply) String

func (r EchoReply) String() string

type Settings

type Settings struct {
	Bytes          int           //Byte ammout to send in the icmp Message
	TOS            int           //The DSCP code to set in the IP Header
	TTL            int           //THe time to live value to set in the IP Header
	Timeout        time.Duration //THe maximum ammount of time to wait for an answer
	CyclesCount    int           //How many times to ping the  TargetList
	CyclesInterval time.Duration //The mimnum interval between cycles
}

Ping Settings

type Summary

type Summary struct {
	Target *Target //The target device
	Sent   float64 //The number of ping sents
	Recv   float64 //The number of succesful replies received
	Max    float64 //The maximum rtt
	Min    float64 //The minimum rtt
	Avg    float64 //The average rtt
}

The summary of all requests for a target

type Target

type Target struct {
	From     *net.IPAddr       //The source ip address
	IP       *net.IPAddr       //The target IP Address
	UserData map[string]string //UserData passed by the user
}

The target host to be pinged

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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