hyperi_rustlib/health/mod.rs
1// Project: hyperi-rustlib
2// File: src/health/mod.rs
3// Purpose: Unified health registry for service health state
4// Language: Rust
5//
6// License: FSL-1.1-ALv2
7// Copyright: (c) 2026 HYPERI PTY LIMITED
8
9//! Unified health registry for service readiness and liveness.
10//!
11//! Provides a global singleton [`HealthRegistry`] that modules register
12//! into at construction. The `/readyz` endpoint (or any health check)
13//! queries the registry to determine overall service health.
14//!
15//! # Usage
16//!
17//! ```rust
18//! use hyperi_rustlib::health::{HealthRegistry, HealthStatus};
19//!
20//! // Register a component health check at construction
21//! HealthRegistry::register("kafka_consumer", || HealthStatus::Healthy);
22//!
23//! // Query overall health
24//! assert!(HealthRegistry::is_ready());
25//! ```
26
27pub mod registry;
28
29pub use registry::{HealthRegistry, HealthStatus};