health

package
v1.10.17 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2021 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checkable

type Checkable interface {
	// Checkables should return nil if ready, or an error message otherwise.
	Ready() error
	// Checkables should return nil if healthy, or an error message otherwise.
	Healthy() error
}

Types requiring health checks should implement the Checkable interface.

type Checker

type Checker interface {
	// Register a service for health checks.
	Register(name string, service Checkable) error
	// Unregister a service.
	Unregister(name string) error
	// IsReady returns the current readiness of the system.
	// A system is considered ready if all checks are passing (no errors)
	IsReady() (ready bool, errors map[string]error)
	// IsHealthy returns the current health of the system.
	// A system is considered healthy if all checks are passing (no errors)
	IsHealthy() (healthy bool, errors map[string]error)

	Start() error
	Close() error
}

Checker provides a service which can be probed for system health.

func NewChecker

func NewChecker() Checker

type State

type State struct {
	// contains filtered or unexported fields
}

type Status

type Status string
const (
	StatusPassing Status = "passing"
	StatusFailing Status = "failing"
)

Jump to

Keyboard shortcuts

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