//! OpenTelemetry HTTP server for mi6.
//!
//! This crate provides an HTTP server that receives OpenTelemetry log data
//! and stores it using the mi6 storage backend. It isolates the HTTP server
//! dependencies (tiny_http) from mi6-core and enables reuse in other tools.
//!
//! # Architecture
//!
//! - [`server`] - HTTP server implementation for receiving OTel logs
//! - [`lifecycle`] - Process management (start/stop/status)
//!
//! # Example
//!
//! ```no_run
//! use mi6_otel_server::{ensure_running, stop_server, is_server_running, DEFAULT_PORT};
//!
//! // Check if server is running
//! if !is_server_running(DEFAULT_PORT) {
//!     // Start the server (None uses default mode from config)
//!     ensure_running(DEFAULT_PORT, false, None).unwrap();
//! }
//!
//! // Later, stop the server
//! stop_server(DEFAULT_PORT).unwrap();
//! ```

// Allow stderr for server status messages
#![allow(clippy::print_stderr)]

pub mod lifecycle;
pub mod server;

// Re-export commonly used items
pub use lifecycle::{
    DEFAULT_PORT, OtelServerStatus, default_port, ensure_running, find_available_port, get_status,
    is_mi6_server, is_server_running, stop_server,
};
pub use server::run_server;
