pub mod probe;
pub use probe::{HealthCheck, liveness_handler, readiness_handler};
#[derive(Debug, Clone)]
pub enum HealthStatus {
Healthy,
Unhealthy(String),
}
#[derive(Debug, Clone)]
pub struct HealthReport {
pub status: HealthStatus,
pub checks: Vec<CheckResult>,
}
#[derive(Debug, Clone)]
pub struct CheckResult {
pub name: String,
pub healthy: bool,
pub message: Option<String>,
}
impl HealthReport {
pub fn healthy() -> Self {
Self {
status: HealthStatus::Healthy,
checks: vec![],
}
}
pub fn unhealthy(reason: &str) -> Self {
Self {
status: HealthStatus::Unhealthy(reason.to_string()),
checks: vec![],
}
}
}