Skip to main content

logdive_api/
lib.rs

1//! # logdive-api
2//!
3//! Read-only HTTP API server over a logdive index.
4//!
5//! Exposes two endpoints, per the decisions log:
6//!   - `GET /query?q=<expr>&limit=<n>` — runs a query and returns matching
7//!     log entries as newline-delimited JSON.
8//!   - `GET /stats` — returns aggregate metadata about the index as a
9//!     single JSON object.
10//!
11//! The server is strictly read-only. Ingestion is the CLI's responsibility
12//! and is out of scope here; authentication is similarly out of scope for
13//! v1 per the decisions log entry on HTTP surface area.
14//!
15//! This crate is both a binary (`logdive-api`) and a library. The library
16//! half exists so integration tests can construct the router without
17//! duplicating its definition — they use [`router::build_router`] the
18//! same way the binary does.
19
20pub mod error;
21pub mod handlers;
22pub mod router;
23pub mod state;