health

package
v0.0.0-...-ba64992 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrAlreadyRegistered = errors.New("already registered")
)

Functions

This section is empty.

Types

type Checker

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

func NewChecker

func NewChecker() *Checker

func (*Checker) Check

func (h *Checker) Check() *Response

func (*Checker) Register

func (h *Checker) Register(name string, critical bool, provider Provider) error

func (*Checker) SetEnabled

func (h *Checker) SetEnabled(providerName string, enabled bool)

type Health

type Health struct {
	Status Status `json:"status"`
	Reason string `json:"reason,omitempty"`
}

type Provider

type Provider interface {
	Check() Health
}

type Response

type Response struct {
	Status  Status            `json:"status"`
	Details map[string]Health `json:"details"`
}

type Status

type Status = string
const (
	StatusUp       Status = "UP"
	StatusDown     Status = "DOWN"
	StatusDisabled Status = "DISABLED"
)

Jump to

Keyboard shortcuts

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