reifydb_sub_server/
lib.rs

1// Copyright (c) reifydb.com 2025
2// This file is licensed under the AGPL-3.0-or-later
3
4//! Common infrastructure for HTTP and WebSocket server subsystems.
5//!
6//! This crate provides shared types and utilities used by `sub-server-http` and
7//! `sub-server-ws`. It includes:
8//!
9//! - **Authentication**: Identity extraction from headers and tokens
10//! - **Execution**: Async wrappers around synchronous database operations
11//! - **Response**: Frame conversion for JSON serialization
12//! - **Runtime**: Shared tokio runtime management
13//! - **State**: Application state for request handlers
14
15#![cfg_attr(not(debug_assertions), deny(warnings))]
16
17mod auth;
18mod execute;
19mod response;
20mod runtime;
21mod state;
22
23// Authentication exports
24pub use auth::{
25	AuthError, AuthResult, anonymous_identity, extract_identity_from_api_key, extract_identity_from_auth_header,
26	extract_identity_from_ws_auth, root_identity,
27};
28// Query execution exports
29pub use execute::{
30	ExecuteError, ExecuteResult, execute_command, execute_command_single, execute_query, execute_query_single,
31};
32// Response conversion exports
33pub use response::{ResponseColumn, ResponseFrame, convert_frames};
34// Runtime exports
35pub use runtime::{SharedRuntime, get_num_cpus};
36// State exports
37pub use state::{AppState, QueryConfig};