Module health

Module health 

Source
Expand description

Health check system for monitoring application health

This module provides a flexible health check system for monitoring the health and readiness of your application and its dependencies.

§Example

use rustapi_core::health::{HealthCheck, HealthCheckBuilder, HealthStatus};

#[tokio::main]
async fn main() {
    let health = HealthCheckBuilder::new(true)
        .add_check("database", || async {
            // Check database connection
            HealthStatus::healthy()
        })
        .add_check("redis", || async {
            // Check Redis connection
            HealthStatus::healthy()
        })
        .build();

    // Use health.execute().await to get results
}

Structs§

HealthCheck
Health check configuration
HealthCheckBuilder
Builder for health check configuration
HealthCheckResult
Overall health check result

Enums§

HealthStatus
Health status of a component

Type Aliases§

HealthCheckFn
Type alias for async health check functions