pub struct ConfigManager { /* private fields */ }Expand description
Main configuration manager
Implementations§
Source§impl ConfigManager
impl ConfigManager
Sourcepub async fn new_with_mock_secrets(
config_path: impl Into<PathBuf>,
) -> Result<Self>
pub async fn new_with_mock_secrets( config_path: impl Into<PathBuf>, ) -> Result<Self>
Create a new configuration manager with a mock secrets for testing
Sourcepub async fn with_sync(
config_path: impl Into<PathBuf>,
api_url: Option<String>,
tenant_id: Option<String>,
auto_sync: bool,
runtime_mode: RuntimeMode,
) -> Result<Self>
pub async fn with_sync( config_path: impl Into<PathBuf>, api_url: Option<String>, tenant_id: Option<String>, auto_sync: bool, runtime_mode: RuntimeMode, ) -> Result<Self>
Create a configuration manager with cloud sync enabled
Sourcepub async fn set_secret(&self, key: &str, value: &str) -> Result<()>
pub async fn set_secret(&self, key: &str, value: &str) -> Result<()>
Set a secret value Note: With SecretManager, this might fail if not using mock store. Users should set secrets in .env.
Sourcepub async fn delete_secret(&self, key: &str) -> Result<()>
pub async fn delete_secret(&self, key: &str) -> Result<()>
Delete a secret
Sourcepub async fn sync_from_cloud(&self) -> Result<Option<Config>>
pub async fn sync_from_cloud(&self) -> Result<Option<Config>>
Sync configuration from cloud
Sourcepub async fn sync_to_cloud(
&self,
config: &Config,
) -> Result<Option<SyncResponse>>
pub async fn sync_to_cloud( &self, config: &Config, ) -> Result<Option<SyncResponse>>
Sync configuration to cloud
Sourcepub fn sync_status(&self) -> SyncStatus
pub fn sync_status(&self) -> SyncStatus
Get sync status
Sourcepub fn config_path(&self) -> &Path
pub fn config_path(&self) -> &Path
Get the config file path
Auto Trait Implementations§
impl Freeze for ConfigManager
impl RefUnwindSafe for ConfigManager
impl Send for ConfigManager
impl Sync for ConfigManager
impl Unpin for ConfigManager
impl UnsafeUnpin for ConfigManager
impl UnwindSafe for ConfigManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more