pub struct CommonConfig {
pub service_name: String,
pub log_level: String,
pub cors_allowed_origins: Vec<String>,
pub cors_allowed_headers: Vec<String>,
pub custom: HashMap<String, String>,
}Expand description
Configuration for the common crate that can be overridden by microservices
Fields§
§service_name: StringService name for logging and tracing
log_level: StringDefault log level
cors_allowed_origins: Vec<String>Custom headers for CORS
cors_allowed_headers: Vec<String>Custom headers for CORS
custom: HashMap<String, String>Additional configuration that can be extended by microservices
Implementations§
Source§impl CommonConfig
impl CommonConfig
Sourcepub fn with_log_level(self, level: impl Into<String>) -> Self
pub fn with_log_level(self, level: impl Into<String>) -> Self
Set log level
Sourcepub fn with_cors_origins(self, origins: Vec<String>) -> Self
pub fn with_cors_origins(self, origins: Vec<String>) -> Self
Set CORS allowed origins
Sourcepub fn with_cors_headers(self, headers: Vec<String>) -> Self
pub fn with_cors_headers(self, headers: Vec<String>) -> Self
Set CORS allowed headers
Trait Implementations§
Source§impl Clone for CommonConfig
impl Clone for CommonConfig
Source§fn clone(&self) -> CommonConfig
fn clone(&self) -> CommonConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CommonConfig
impl Debug for CommonConfig
Auto Trait Implementations§
impl Freeze for CommonConfig
impl RefUnwindSafe for CommonConfig
impl Send for CommonConfig
impl Sync for CommonConfig
impl Unpin for CommonConfig
impl UnsafeUnpin for CommonConfig
impl UnwindSafe for CommonConfig
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