ping

package
v0.0.0-...-23f1273 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2019 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadEndpoints

func ReadEndpoints(filename string) (map[string]string, map[string]string, error)

ReadEndpoints parse CSV file into map of region names and endpoints

Types

type CmdOption

type CmdOption struct {
	Option     string
	OptionName string
	ListFlg    bool
	Args       []string
}

CmdOption is to save cmd option

func (*CmdOption) StartCmd

func (c *CmdOption) StartCmd()

StartCmd is to excute functions and differentiate report depends on cmd option

type PingDto

type PingDto struct {
	Region  string
	Name    string
	Address string
	Latency time.Duration
}

PingDto is for endpoint and reponse time information

func (*PingDto) Ping

func (p *PingDto) Ping()

Ping Send HTTP(S) request to endpoint and report its response time

func (*PingDto) TestPrint

func (p *PingDto) TestPrint()

TestPrint prints the PingDto struct.

func (*PingDto) VerbosePing

func (p *PingDto) VerbosePing()

VerbosePing send HTTP(S) request to endpoint and report its respons time in httpstat style

type TimeTrace

type TimeTrace struct {
	DNSLookup       time.Duration
	TCPConnect      time.Duration
	TLSHandshake    time.Duration
	ServerProcess   time.Duration
	ContentTransfer time.Duration
	NameLookup      time.Duration
	ConnectTotal    time.Duration
	PreTransfer     time.Duration
	StartTransfer   time.Duration
	TotalTime       time.Duration
}

TimeTrace will be used for report httpstat

func (*TimeTrace) PrintHttpTrace

func (t *TimeTrace) PrintHttpTrace()

PrintHttpTrace prints TimeTrace struct in httpstat style This function's codes are from https://github.com/reoim/httpstat-1 They are slightly different from the original codes. But I used the same template and print format.

Jump to

Keyboard shortcuts

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