Skip to main content

Crate docspec_http

Crate docspec_http 

Source
Expand description

HTTP API server for DocSpec document conversion.

Re-exports§

pub use cli::Args;
pub use server::serve;
pub use server::ServerError;

Modules§

cache
Cache-Control middleware for all HTTP responses.
cli
Command-line interface arguments for the docspec-http server binary.
error
Error types for the HTTP server.
format
MIME type and HTTP header constants for the conversion API.
handlers
HTTP request handlers.
metrics
Prometheus metrics for the docspec-http server.
mime_parser
HTTP Accept negotiation and Content-Type validation for the conversion API.
router
HTTP router and route definitions.
server
HTTP server implementation.
telemetry
Telemetry facade. Currently wraps Sentry. Designed for extraction to docspec-telemetry when (a) OpenTelemetry is added, OR (b) docspec-cli wants Sentry, OR (c) Prometheus metrics land. Keep the public API surface stable and free of HTTP-specific types.
tracing_init
Tracing subscriber initialization.

Functions§

init_telemetry
Initialize Sentry (if DSN env var set) and return a guard that flushes Sentry on drop. MUST be called BEFORE building the tokio runtime; main() MUST hold the returned guard for the entire process lifetime.
init_tracing
Initialize the global tracing subscriber. Called internally by run_server.
run_server
Synchronous server entrypoint. Builds a multi-threaded tokio runtime, installs the global tracing subscriber, and runs the HTTP server until SIGINT/SIGTERM.