Documentation
¶
Overview ¶
Package ps_healthcheck exposes the standard k8s probes (/healthz, /readyz, /startupz) on an HTTP mux. /healthz is liveness — always 200 while the process is up. /readyz runs caller-supplied probes (Mongo / Redis pings) and returns 503 if any probe fails; this is what k8s should be wired to.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Options ¶
type Options struct {
Probes map[string]Probe
StartupReady *atomic.Bool
DrainingCtx context.Context
}
Options configures Register. Probes is a name→check map; the readyz handler fans out and reports the first failure. StartupReady toggles /startupz from 503 to 200 when set; if nil, /startupz mirrors /healthz. Draining, when set and true, forces /readyz to 503 without running probes — this is the lame-duck signal flipped on SIGTERM so k8s pulls the pod out of the load balancer before the servers shut down.