Skip to main content

Module probe

Module probe 

Source
Expand description

Reusable liveness/readiness probe DTOs and response helpers.

Products wire these into their own /health and /readyz handlers, supplying whatever async check represents “ready” for them.

Structs§

LivenessBody
ReadinessBody

Enums§

LivenessStatus
The one liveness value this crate emits. An enum (rather than a bare &'static str) so a second construction site can’t drift to an unintended value — mirrors ReadinessStatus below.
ReadinessStatus
The two readiness values this crate emits. An enum (rather than a bare &'static str) so callers can’t construct a third, unintended status value that this module’s response builders never produce.

Functions§

liveness_response
200 OK liveness response — “the process is up”.
readiness_response
Readiness response from a dependency check: 200 OK with {"status": "ready"} on success, 503 Service Unavailable with the failure reason on error. Unlike liveness, readiness probes an upstream dependency so orchestrators only route traffic once the service can actually serve it.