ping

package
Version: v0.2.6 Latest Latest
Warning

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

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

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Normalize

func Normalize(URL string) string

Normalize fixes scheme

Types

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

Source Files

Jump to

Keyboard shortcuts

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