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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
//! # Distributed Config
//!
//! `distributed-config` is a robust configuration management library for Rust applications
//! running in distributed environments. It provides a unified interface for loading,
//! accessing, and synchronizing configuration across multiple nodes with support for
//! dynamic updates, validation, and various backend stores.
//!
//! ## Features
//!
//! - **Hierarchical Configuration**: Organize configuration in a tree structure
//! - **Multiple Sources**: Load from files, environment variables, and remote sources
//! - **Dynamic Updates**: Real-time configuration changes with notifications
//! - **Schema Validation**: Strong typing and validation support
//! - **Distributed Sync**: Synchronize configuration across multiple nodes
//! - **Feature Flags**: Built-in feature flag management
//! - **Versioning**: Configuration history and rollback support
//!
//! ## Quick Start
//!
//! ```rust,no_run
//! use distributed_config::{ConfigManager, sources::FileSource};
//! use serde::{Deserialize, Serialize};
//!
//! #[derive(Debug, Deserialize, Serialize)]
//! struct AppConfig {
//! host: String,
//! port: u16,
//! debug: bool,
//! }
//!
//! #[tokio::main]
//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
//! let mut config = ConfigManager::new();
//!
//! // Add a file source
//! let file_source = FileSource::new().add_file("config.yaml", None);
//! config.add_source(file_source, 10);
//!
//! // Initialize and load configuration
//! config.initialize().await?;
//!
//! // Access typed configuration
//! let app_config = config.get::<AppConfig>("app").await?;
//! println!("Server running on {}:{}", app_config.host, app_config.port);
//!
//! Ok(())
//! }
//! ```
// Future: Optional backends module for Redis, etcd support
// #[cfg(feature = "redis-backend")]
// pub mod backends;
// Re-export main types for convenient access
pub use ;
pub use ConfigManager;
pub use ;
pub use SchemaValidator;
pub use ConfigValue;
pub use ;
pub use RemoteSource;
/// Type alias for configuration change notifications
pub type ChangeNotification = ConfigChange;
/// Initialize tracing for the library