Skip to main content

systemprompt_api/services/server/
mod.rs

1//! API server assembly, lifecycle, and readiness.
2//!
3//! [`startup`] binds the TCP listener before bootstrap and serves a starting
4//! health probe; [`builder`] composes the full axum router and global
5//! middleware stack; [`runner`] runs the startup reconciliation, swaps the
6//! full router onto the listener, and awaits shutdown. The readiness
7//! signalling surface ([`is_ready`], [`signal_ready`], [`wait_for_ready`]) is
8//! used by external health probes. Discovery, health, metrics, and route
9//! configuration live in the private submodules.
10
11pub mod builder;
12mod discovery;
13mod health;
14
15#[cfg(feature = "test-api")]
16pub mod test_api {
17    #[cfg(target_os = "linux")]
18    pub use super::health::parse_proc_status_kb;
19    pub use super::health::{audit_log_stats, database_stats, human_bytes, table_stats};
20    pub use super::health_detail::handle_health_detail;
21}
22mod health_detail;
23mod lifecycle;
24pub mod metrics;
25pub mod readiness;
26mod routes;
27pub mod runner;
28pub mod scheduler_health;
29mod shutdown;
30pub mod startup;
31
32#[cfg(feature = "test-api")]
33pub use lifecycle::reconciliation_test_api;
34#[cfg(feature = "test-api")]
35pub use shutdown::test_api as shutdown_test_api;
36
37pub use builder::*;
38pub use readiness::{
39    ReadinessEvent, get_readiness_receiver, init_readiness, is_ready, signal_ready,
40    signal_shutdown, wait_for_ready,
41};
42pub use runner::*;
43pub use startup::{EarlyServer, bind_and_serve, starting_router};