health

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: MIT Imports: 5 Imported by: 0 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

func RegisterRoutes

func RegisterRoutes(r *teapot.Router, h RouteHandlers)

RegisterRoutes registers all health check routes on r. When metadata or rootFS is nil (e.g. CLI route listing), plain 200 fallbacks are used.

Types

type Handler

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

Handler implements the /health, /health/ready, and /health/live endpoints.

func New

func New(metadata Pinger, rootFS billy.Filesystem) *Handler

New creates a Handler. metadata and rootFS are used for readiness probes.

func (*Handler) HandleHealth

func (h *Handler) HandleHealth() http.Handler

HandleHealth returns a JSON summary of all component statuses. HTTP 200 when everything is healthy; 503 when one or more parts are degraded.

func (*Handler) HandleLive

func (h *Handler) HandleLive() http.Handler

HandleLive is a liveness probe: always 200 if the process is reachable and not deadlocked. Kept as /healthz alias for backwards compatibility with Docker health checks and the performance test wait loop.

func (*Handler) HandleReady

func (h *Handler) HandleReady() http.Handler

HandleReady is a readiness probe: 200 when BoltDB and storage are accessible, 503 otherwise. Used by load balancers and orchestrators to gate traffic.

type Pinger

type Pinger interface {
	Ping() error
}

Pinger is satisfied by *metadata.Manager.

type RouteHandlers

type RouteHandlers interface {
	HandleHealth() http.Handler
	HandleLive() http.Handler
	HandleReady() http.Handler
}

Jump to

Keyboard shortcuts

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