Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Checkable ¶ added in v1.0.0
type Checkable interface {
CheckHealth() State
}
Checkable is the interface implemented by subsystems that the checker uses to determine subsystem health.
type Checker ¶
Checker is responsible for running health checks and serving the healthcheck HTTP paths
type Config ¶
type Config struct {
ListenerEnabled bool `hcl:"listener_enabled"`
// Address and port to listen on, defaulting to localhost:80
BindAddress string `hcl:"bind_address"`
BindPort string `hcl:"bind_port"`
// Paths for /ready and /live
ReadyPath string `hcl:"ready_path"`
LivePath string `hcl:"live_path"`
UnusedKeyPositions map[string][]token.Pos `hcl:",unusedKeyPositions"`
}
type Details ¶ added in v0.12.2
type Details struct {
Message string `json:"message,omitempty"`
}
Details are additional data to be used when the system is ready
type ServableChecker ¶ added in v1.0.0
func NewChecker ¶
func NewChecker(config Config, log logrus.FieldLogger) ServableChecker
type State ¶ added in v1.0.0
type State struct {
// Started is whether the subsystem is finished starting.
// if undefined, it is treated as started=true.
Started *bool
// Live is whether the subsystem is live (i.e. in a good state
// or in a state it can recover from while remaining alive). Global
// liveness is only reported true if all subsystems report live.
Live bool
// Ready is whether the subsystem is ready (i.e. ready to perform
// its function). Global readiness is only reported true if all subsystems
// report ready.
Ready bool
// Subsystems can return whatever details they want here as long as it is
// serializable via json.Marshal.
// LiveDetails are opaque details related to the live check.
LiveDetails any
// ReadyDetails are opaque details related to the live check.
ReadyDetails any
}
State is the health state of a subsystem.
Click to show internal directories.
Click to hide internal directories.