ping

package
v0.0.0-...-ba1c585 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2017 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

Package ping provides a mechanism for pinging a set of servers in parallel to identify responsive ones.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PingInParallel

func PingInParallel(ctx *context.T, names []string, timeout, channelTimeout time.Duration) (map[string]PingResult, error)

PingInParallel attempts to make a connection in parallel to all specified names, waits for some time, then returns a map of name to PingResult.

  • 'timeout' is the maximum duration that PingInParallel will wait before cancelling any outstanding calls and returning.
  • 'channelTimeout' is the channelTimeout that will be used for healthchecks on any created connections.

Notes:

  • PingInParallel may report erroneous ping latencies if the system clock changes during the call. Clients must be resilient to such errors.

Types

type PingResult

type PingResult struct {
	Name string          // name that was pinged
	Err  error           // either a connection error or a timeout/canceled error
	Conn flow.PinnedConn // the PinnedConn to the remote end.
}

PingResult is the result of a single ping.

Jump to

Keyboard shortcuts

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