wsprism_gateway/lib.rs
1//! wsPrism gateway library entry.
2//!
3//! This crate assembles the production gateway stack:
4//! - Transport: Axum-based WebSocket upgrade with handshake defense, tenant caps,
5//! slow-consumer protection, and trace-id propagation.
6//! - Policy: Allowlist, rate limiting, session/room governance, and hot-lane behavior.
7//! - Dispatch: Routes ext/hot messages to registered services.
8//! - Realtime core: Session/room registries, lossy/reliable egress.
9//! - Observability: Labeled counters/gauges/histograms, sys.* envelopes with trace_id,
10//! and /metrics exposure via ops endpoints.
11//! - Ops: /healthz, /readyz, /metrics, graceful drain.
12//! - Built-ins: room/sys/chat services provided out-of-the-box; additional
13//! services can be registered via dispatcher modules.
14//!
15//! The gateway is designed for panic-free operation: upstream errors surface as
16//! structured `WsPrismError` responses instead of crashing the process.
17//! This crate is consumed by the binary (`main.rs`) and by integration tests.
18
19pub mod app_state;
20pub mod config;
21pub mod context;
22pub mod policy;
23pub mod router;
24pub mod transport;
25pub mod dispatch;
26pub mod realtime;
27pub mod services;
28pub mod ops;
29pub mod obs;