Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Build ¶
func Build(host string, ipv IPVersion, maxTTL int, timeout time.Duration, callback func(hop *Hop, err error)) error
Build makes the route to the target host. After every probe, it calls the callback function (so the caller don't have to wait when all probes are made to build an output).
Example ¶
cb := func(hop *Hop, err error) { if err != nil { log.Fatal(err) } log.Printf("%+v", hop) } if err := Build("google.com", IPv6, 64, time.Second, cb); err != nil { log.Fatal(err) } if err := Build("google.com", IPv4, 64, time.Second, cb); err != nil { log.Fatal(err) }
Output:
Types ¶
type Hop ¶
Hop represents a single hop info: sequence number, hostname and address, latency, received icmp message.
Click to show internal directories.
Click to hide internal directories.