healthchecks

package
v0.0.0-...-c1d0e24 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2021 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checker

type Checker interface {
	// IsDown returns true if the server is down.
	IsDown(serviceID string, key *types.RealServer_Key) bool
	// SetHealthCheck on the given server, replacing any existing health check.
	SetHealthCheck(serviceID string, key *types.RealServer_Key, check *types.RealServer_HealthCheck,
		fn TransitionFunc) error
	// RemHealthCheck for the given server.
	RemHealthCheck(serviceID string, key *types.RealServer_Key)
	// Stop all health checks. Use at shutdown.
	Stop()
}

Checker checks if the real servers of a virtual service are up.

func New

func New() Checker

New creates a new checker.

type ServerStatus

type ServerStatus bool

ServerStatus of a server.

const (
	// ServerUp if server is healthy.
	ServerUp ServerStatus = true
	// ServerDown if server is unhealthy.
	ServerDown ServerStatus = false
)

type TransitionFunc

type TransitionFunc func(state ServerStatus)

TransitionFunc is called on a health state change.

Jump to

Keyboard shortcuts

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