Versions in this module Expand all Collapse all v0 v0.1.0 May 1, 2026 Changes in this version + var ErrAlreadyRegistered = errors.New("health: checker already registered with that name") + var ErrNotFound = errors.New("health: checker not registered with that name") + type Checker interface + Check func(ctx context.Context) Result + Name func() string + type Observer func(name string, result Result) + type Probe string + const ProbeLiveness + const ProbeReadiness + const ProbeStartup + type RegisterOption func(*registerConfig) + func WithSeverity(s Severity) RegisterOption + func WithTimeout(d time.Duration) RegisterOption + type Registry struct + func NewRegistry() *Registry + func (r *Registry) Register(c Checker, opts ...RegisterOption) error + func (r *Registry) Run(ctx context.Context, name string) (Result, error) + func (r *Registry) RunAll(ctx context.Context) + func (r *Registry) Snapshot() map[string]Result + func (r *Registry) SnapshotForProbe(probe Probe) Snapshot + func (r *Registry) Start(ctx context.Context, interval time.Duration) + func (r *Registry) Stop() + func (r *Registry) Subscribe(o Observer) + func (r *Registry) Unregister(name string) + type Result struct + Error string + Latency time.Duration + Message string + Metadata map[string]any + Severity Severity + Status Status + Timestamp time.Time + type Severity string + const SeverityCritical + const SeverityDegraded + const SeverityInfo + type Snapshot struct + Checks map[string]Result + Probe Probe + Status Status + Time time.Time + func (s Snapshot) HTTPStatus() int + func (s Snapshot) JSON() ([]byte, error) + type Status string + const StatusDegraded + const StatusDown + const StatusUnknown + const StatusUp