v0.2.6 Latest Latest

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

Go to latest
Published: Nov 18, 2016 License: MIT Imports: 15 Imported by: 13



Package ping tries to ping a HTTP server through different ways Connection, Session (Head), Get and Post



This section is empty.


This section is empty.


func Normalize

func Normalize(URL string) string

Normalize fixes scheme


type Ping

type Ping struct {
	TLSSkipVerify bool
	// contains filtered or unexported fields

Ping represents HTTP ping request

func NewPing

func NewPing(args string, cfg cli.Config) (*Ping, error)

NewPing validate and constructs request object

func (*Ping) Ping added in v0.2.3

func (p *Ping) Ping() (Result, error)

Ping tries to ping a web server through http

func (*Ping) Run

func (p *Ping) Run()

Run tries to ping w/ pretty print

type Result

type Result struct {
	StatusCode int
	TotalTime  float64
	Size       int
	Proto      string
	Server     string
	Status     string
	Trace      Trace

Result holds Ping result

func (Result) PrintPingResult added in v0.2.5

func (r Result) PrintPingResult(p *Ping, seq int, err error)

PrintPingResult prints result from each individual ping

type Trace added in v0.2.5

type Trace struct {
	ConnectionTime  float64
	TimeToFirstByte float64

Trace holds trace results

Jump to

Keyboard shortcuts

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