ping

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Trace

type Trace struct {
	Host          string        `json:"host"`
	DNSLookupTime time.Duration `json:"dnsLookupTime"`
	Response      string        `json:"response"`
	ResponseTime  time.Duration `json:"responseTime"`
	RoundTripTime time.Duration `json:"roundTripTime,omitempty"`
	// contains filtered or unexported fields
}

Trace is a ping trace and all the info associated

func FastestTrace

func FastestTrace(traces []Trace) (Trace, error)

FastestTrace returns the fastest of a list of traces Error returned on empty list

func (*Trace) ConnectDone

func (t *Trace) ConnectDone(network, addr string, err error)

ConnectDone is the end

func (*Trace) ConnectStart

func (t *Trace) ConnectStart(network, addr string)

ConnectStart is the beginning

func (*Trace) DNSDone

func (t *Trace) DNSDone(info httptrace.DNSDoneInfo)

DNSDone is the end of DNS lookup

func (*Trace) DNSStart

func (t *Trace) DNSStart(info httptrace.DNSStartInfo)

DNSStart is the start of DNS

func (*Trace) GotConn

func (t *Trace) GotConn(info httptrace.GotConnInfo)

GotConn prints whether the connection has been used previously for the current request.

func (*Trace) GotFirstResponseByte

func (t *Trace) GotFirstResponseByte()

GotFirstResponseByte is the first response byte

func (*Trace) RoundTrip

func (t *Trace) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip wraps http.DefaultTransport.RoundTrip to keep track of the current request.

func (*Trace) Run

func (t *Trace) Run() error

Run does the ping trace

Jump to

Keyboard shortcuts

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