1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
//! Configuration module
//!
//! This module handles loading and validating dbrest configuration from
//! files and environment variables.
//!
//! # Configuration Sources
//!
//! Configuration is loaded in the following order of precedence (highest first):
//!
//! 1. Environment variables (`DBRST_*`)
//! 2. Configuration file values
//! 3. Default values
//!
//! # Example
//!
//! ```ignore
//! use dbrest::config::load_config;
//! use std::collections::HashMap;
//! use std::path::Path;
//!
//! let config = load_config(
//! Some(Path::new("/etc/dbrest/config")),
//! HashMap::new(),
//! ).await?;
//!
//! println!("Server port: {}", config.server_port);
//! ```
//!
//! # Environment Variables
//!
//! All configuration options can be set via environment variables with the `DBRST_` prefix:
//!
//! - `DBRST_DB_URI` → `db-uri`
//! - `DBRST_SERVER_PORT` → `server-port`
//! - `DBRST_JWT_SECRET` → `jwt-secret`
//!
//! Underscores in variable names are converted to hyphens.
// Re-export main types
pub use ConfigError;
pub use ;
pub use ;
pub use ;