probing – github.com/xiang90/probing Index | Files

package probing

import "github.com/xiang90/probing"

Index

Variables

var (
	ErrNotFound = errors.New("probing: id not found")
	ErrExist    = errors.New("probing: id exists")
)

Functions

func NewHandler

func NewHandler() http.Handler

Types

type Health

type Health struct {
	OK  bool
	Now time.Time
}

type Prober

type Prober interface {
	AddHTTP(id string, probingInterval time.Duration, endpoints []string) error
	Remove(id string) error
	RemoveAll()
	Reset(id string) error
	Status(id string) (Status, error)
}

func NewProber

func NewProber(tr http.RoundTripper) Prober

type Status

type Status interface {
	Total() int64
	Loss() int64
	Health() bool
	Err() error
	// Estimated smoothed round trip time
	SRTT() time.Duration
	// Estimated clock difference
	ClockDiff() time.Duration
	StopNotify() <-chan struct{}
}

Source Files

prober.go server.go status.go

Version
v0.0.0-20221125231312-a49e3df8f510 (latest)
Published
Nov 25, 2022
Platform
js/wasm
Imports
6 packages
Last checked
now

Tools for package owners.