1mod discovery;
12mod merge;
13mod patterns;
14mod types;
15mod validation;
16
17#[cfg(test)]
18mod integration_tests;
19
20pub use discovery::ConfigDiscovery;
21pub use merge::ConfigMerger;
22#[allow(unused_imports)] pub use patterns::PatternMatcher;
24pub use types::{Config, SyncDirection};
25pub use validation::ConfigValidator;
26
27use crate::error::Result;
28
29pub struct ConfigManager;
31
32impl ConfigManager {
33 #[must_use]
35 pub const fn new() -> Self {
36 Self
37 }
38
39 pub fn load(cli_config_path: Option<&std::path::Path>) -> Result<Config> {
45 let config_files = ConfigDiscovery::discover(cli_config_path)?;
47
48 let merged = ConfigMerger::merge(&config_files)?;
50
51 ConfigValidator::validate(&merged)?;
53
54 Ok(merged)
55 }
56}
57
58impl Default for ConfigManager {
59 fn default() -> Self {
60 Self::new()
61 }
62}
63
64#[cfg(test)]
65mod tests {
66 use super::*;
67
68 #[test]
69 fn test_config_manager_creation() {
70 let _manager = ConfigManager::new();
71 let _default_manager = ConfigManager::default();
72 }
74}