diff --git a/PLAN.md b/PLAN.md index 9c367ec..67ad9bc 100644 --- a/PLAN.md +++ b/PLAN.md @@ -279,7 +279,7 @@ Private helpers (e.g., internal `fn` without `pub`) are not flagged, as they don - `ProgramWriter` struct: Partial. - Impl `Write`: No doc. -52. **src/modes/server/api/status.rs** +52. **src/modes/server/api/status.rs** [DONE] - `handle_status()` function: No doc. 53. **src/filter_plugin/tail.rs** diff --git a/src/modes/server/api/status.rs b/src/modes/server/api/status.rs index 2d8d4f6..69e52e2 100644 --- a/src/modes/server/api/status.rs +++ b/src/modes/server/api/status.rs @@ -22,6 +22,33 @@ use crate::modes::server::common::{AppState, StatusInfoResponse}; ), tag = "status" )] +/// Axum handler for the /api/status GET endpoint. +/// +/// Generates and returns comprehensive system status using the StatusService. +/// Includes paths, plugins, compression info, and configuration details. +/// +/// # Arguments +/// +/// * `State(state)` - The shared AppState containing settings, DB, and paths. +/// +/// # Returns +/// +/// * `Ok(Json)` - Success response with status data. +/// * `Err(StatusCode)` - HTTP error status (e.g., 500 for internal errors; 401 if auth fails elsewhere). +/// +/// # Errors +/// +/// Returns StatusCode::INTERNAL_SERVER_ERROR if status generation panics or fails (current impl assumes success). +/// Auth errors are handled by middleware before reaching this handler. +/// +/// # Examples +/// +/// ``` +/// // In an Axum app: +/// async fn app() -> Result, StatusCode> { +/// handle_status(State(app_state)).await +/// } +/// ``` pub async fn handle_status( State(state): State, ) -> Result, StatusCode> {