pub struct TenantConfigurationManager { /* private fields */ }Expand description
Advanced tenant configuration manager with hot-reloading and validation
Implementations§
Source§impl TenantConfigurationManager
impl TenantConfigurationManager
pub fn new(tenant_id: TenantId) -> Self
Sourcepub fn set_configuration(
&self,
key: String,
value: ConfigurationValue,
schema: ConfigurationSchema,
environment: Option<ConfigurationEnvironment>,
changed_by: String,
change_reason: String,
) -> Result<()>
pub fn set_configuration( &self, key: String, value: ConfigurationValue, schema: ConfigurationSchema, environment: Option<ConfigurationEnvironment>, changed_by: String, change_reason: String, ) -> Result<()>
Set configuration value with validation and hot-reload
Sourcepub fn get_configuration(
&self,
key: &str,
environment: Option<ConfigurationEnvironment>,
) -> Option<ConfigurationValue>
pub fn get_configuration( &self, key: &str, environment: Option<ConfigurationEnvironment>, ) -> Option<ConfigurationValue>
Get configuration value with caching
Sourcepub fn get_all_configurations(
&self,
environment: Option<ConfigurationEnvironment>,
) -> HashMap<String, ConfigurationValue>
pub fn get_all_configurations( &self, environment: Option<ConfigurationEnvironment>, ) -> HashMap<String, ConfigurationValue>
Get all configurations for environment
Sourcepub fn apply_template(
&self,
template_name: &str,
environment: ConfigurationEnvironment,
) -> Result<usize>
pub fn apply_template( &self, template_name: &str, environment: ConfigurationEnvironment, ) -> Result<usize>
Apply configuration template to tenant
Sourcepub fn create_template(&self, template: ConfigurationTemplate) -> Result<()>
pub fn create_template(&self, template: ConfigurationTemplate) -> Result<()>
Create configuration template
Sourcepub fn delete_configuration(
&self,
key: &str,
environment: Option<ConfigurationEnvironment>,
changed_by: String,
change_reason: String,
) -> Result<bool>
pub fn delete_configuration( &self, key: &str, environment: Option<ConfigurationEnvironment>, changed_by: String, change_reason: String, ) -> Result<bool>
Delete configuration
Sourcepub fn get_metrics(&self) -> ConfigurationMetrics
pub fn get_metrics(&self) -> ConfigurationMetrics
Get configuration metrics
Sourcepub fn get_change_history(
&self,
limit: Option<usize>,
) -> Vec<ConfigurationChangeEvent>
pub fn get_change_history( &self, limit: Option<usize>, ) -> Vec<ConfigurationChangeEvent>
Get configuration change history
Sourcepub fn create_rollback_point(
&self,
changed_by: String,
reason: String,
) -> Result<()>
pub fn create_rollback_point( &self, changed_by: String, reason: String, ) -> Result<()>
Create rollback point
Sourcepub fn rollback_to_point(
&self,
rollback_timestamp: DateTime<Utc>,
) -> Result<usize>
pub fn rollback_to_point( &self, rollback_timestamp: DateTime<Utc>, ) -> Result<usize>
Rollback to a specific point in time
Sourcepub fn add_change_listener<F>(&self, listener: F)
pub fn add_change_listener<F>(&self, listener: F)
Add change listener for hot reload
Sourcepub fn set_environment(&mut self, environment: ConfigurationEnvironment)
pub fn set_environment(&mut self, environment: ConfigurationEnvironment)
Set current environment
Sourcepub fn set_hot_reload_enabled(&mut self, enabled: bool)
pub fn set_hot_reload_enabled(&mut self, enabled: bool)
Enable/disable hot reload
Sourcepub fn set_validation_enabled(&mut self, enabled: bool)
pub fn set_validation_enabled(&mut self, enabled: bool)
Enable/disable validation
Sourcepub fn export_configurations(
&self,
environment: Option<ConfigurationEnvironment>,
) -> Value
pub fn export_configurations( &self, environment: Option<ConfigurationEnvironment>, ) -> Value
Export configurations to JSON
Sourcepub fn import_configurations(
&self,
json_data: &Value,
environment: ConfigurationEnvironment,
changed_by: String,
) -> Result<usize>
pub fn import_configurations( &self, json_data: &Value, environment: ConfigurationEnvironment, changed_by: String, ) -> Result<usize>
Import configurations from JSON
Auto Trait Implementations§
impl Freeze for TenantConfigurationManager
impl RefUnwindSafe for TenantConfigurationManager
impl Send for TenantConfigurationManager
impl Sync for TenantConfigurationManager
impl Unpin for TenantConfigurationManager
impl UnwindSafe for TenantConfigurationManager
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more