pub struct ConfigHotReload { /* private fields */ }Expand description
Configuration hot-reload manager with file watching and validation
Implementations§
Source§impl ConfigHotReload
impl ConfigHotReload
Sourcepub async fn New(
config_path: PathBuf,
initial_config: AirConfiguration,
) -> Result<Self>
pub async fn New( config_path: PathBuf, initial_config: AirConfiguration, ) -> Result<Self>
Sourcepub async fn EnableFileWatching(&mut self) -> Result<()>
pub async fn EnableFileWatching(&mut self) -> Result<()>
Enable file watching for configuration changes
Sourcepub async fn DisableFileWatching(&mut self) -> Result<()>
pub async fn DisableFileWatching(&mut self) -> Result<()>
Disable file watching
Sourcepub async fn Reload(&self) -> Result<()>
pub async fn Reload(&self) -> Result<()>
Reload configuration from file with retry logic and rollback support
Sourcepub async fn ReloadAndValidate(&self) -> Result<()>
pub async fn ReloadAndValidate(&self) -> Result<()>
Reload and validate configuration (alias for Reload)
Sourcepub async fn TriggerReload(&self) -> Result<()>
pub async fn TriggerReload(&self) -> Result<()>
Trigger a manual reload
Sourcepub async fn RegisterValidator(&self, validator: Box<dyn ConfigValidator>)
pub async fn RegisterValidator(&self, validator: Box<dyn ConfigValidator>)
Register a custom validator
Sourcepub async fn GetConfig(&self) -> AirConfiguration
pub async fn GetConfig(&self) -> AirConfiguration
Get current configuration
Sourcepub async fn GetConfigRef(&self) -> RwLockReadGuard<'_, AirConfiguration>
pub async fn GetConfigRef(&self) -> RwLockReadGuard<'_, AirConfiguration>
Get current configuration (read-only, non-copying)
Sourcepub async fn SetValue(&self, path: &str, value: &str) -> Result<()>
pub async fn SetValue(&self, path: &str, value: &str) -> Result<()>
Set configuration value by path (e.g., “grpc.bind_address”)
Sourcepub async fn GetChangeHistory(
&self,
limit: Option<usize>,
) -> Vec<ConfigChangeRecord>
pub async fn GetChangeHistory( &self, limit: Option<usize>, ) -> Vec<ConfigChangeRecord>
Get change history
Sourcepub async fn GetLastReload(&self) -> Option<DateTime<Utc>>
pub async fn GetLastReload(&self) -> Option<DateTime<Utc>>
Get last reload timestamp
Sourcepub async fn GetLastReloadDuration(&self) -> Option<Duration>
pub async fn GetLastReloadDuration(&self) -> Option<Duration>
Get last reload duration
Sourcepub async fn SetAutoRollback(&self, enabled: bool)
pub async fn SetAutoRollback(&self, enabled: bool)
Set whether auto-rollback is enabled
Sourcepub fn SubscribeChanges(&self) -> Receiver<ConfigChangeEvent>
pub fn SubscribeChanges(&self) -> Receiver<ConfigChangeEvent>
Get configuration change event receiver
This can be used to subscribe to configuration change notifications
Sourcepub fn GetConfigPath(&self) -> &Path
pub fn GetConfigPath(&self) -> &Path
Get configuration path
Sourcepub async fn SetDebounceDelay(&self, delay: Duration)
pub async fn SetDebounceDelay(&self, delay: Duration)
Set debounce delay
Auto Trait Implementations§
impl Freeze for ConfigHotReload
impl !RefUnwindSafe for ConfigHotReload
impl Send for ConfigHotReload
impl Sync for ConfigHotReload
impl Unpin for ConfigHotReload
impl !UnwindSafe for ConfigHotReload
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].