forklaunch 1.35.0

Launch faster with forklaunch
1
2
3
4
5
6
7
8
9
10
use crate::{domain::schemas::HealthResponse, persistence::InMemoryRepository};
#[derive(Clone)]
pub struct HealthService { name: String, repository: InMemoryRepository }
impl HealthService {
    pub fn new(name: String, repository: InMemoryRepository) -> Self { Self { name, repository } }
    pub fn report(&self) -> HealthResponse {
        HealthResponse { service: self.name.clone(), status: "ok".into(),
            record_count: self.repository.count().unwrap_or_default(), routes: vec!["health".into()] }
    }
}