health

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2021 License: MIT Imports: 6 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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