pub struct DarkwingConfig {Show 28 fields
pub cargo_env: CargoEnv,
pub port: u16,
pub database_url: String,
pub database_connection_pool_size: u32,
pub redis_url: String,
pub redis_connection_pool_size: u32,
pub redis_default_timeout_seconds: u64,
pub redis_expiration_seconds: u64,
pub jwt_token_public_key: String,
pub jwt_token_algorithm: String,
pub config_encryption_key: String,
pub rate_limit_per_second: u64,
pub aws_s3_access_key_id: String,
pub aws_s3_secret_access_key: String,
pub aws_s3_endpoint: String,
pub aws_s3_bucket: String,
pub aws_s3_region: String,
pub aws_s3_public_url: String,
pub aws_s3_backup_access_key_id: String,
pub aws_s3_backup_secret_access_key: String,
pub aws_s3_backup_endpoint: String,
pub aws_s3_backup_bucket: String,
pub aws_s3_backup_region: String,
pub database_encryption_key_part_1: String,
pub database_encryption_key_part_2: String,
pub aws_s3_presigned_url_expiration_seconds: u64,
pub s3_path_encryption_key: String,
pub sentry_dsn: Option<String>,
}Expand description
Main configuration structure for the Darkwing application.
This struct is populated using command line arguments or environment
variables through the clap crate’s derive functionality. Each field
corresponds to a configurable aspect of the application.
Fields§
§cargo_env: CargoEnvThe environment in which the application is running
port: u16Port number on which the server will listen
database_url: StringDatabase connection string
database_connection_pool_size: u32Maximum number of connections in the database connection pool
redis_url: StringRedis server connection string
redis_connection_pool_size: u32Maximum number of connections in the Redis connection pool
redis_default_timeout_seconds: u64Default timeout for Redis operations in seconds
redis_expiration_seconds: u64Time-to-live for Redis cache entries in seconds
jwt_token_public_key: StringPublic key used for JWT token verification
jwt_token_algorithm: StringAlgorithm used for JWT token signing/verification (e.g., “RS256”)
config_encryption_key: StringKey used for encrypting configuration values
rate_limit_per_second: u64Maximum number of requests allowed per second for rate limiting
aws_s3_access_key_id: StringAWS S3 access key ID for primary storage
aws_s3_secret_access_key: StringAWS S3 secret access key for primary storage
aws_s3_endpoint: StringAWS S3 endpoint URL for primary storage
aws_s3_bucket: StringAWS S3 bucket name for primary storage
aws_s3_region: StringAWS S3 region for primary storage
aws_s3_public_url: StringPublic URL for accessing S3 objects
aws_s3_backup_access_key_id: StringAWS S3 access key ID for backup storage
aws_s3_backup_secret_access_key: StringAWS S3 secret access key for backup storage
aws_s3_backup_endpoint: StringAWS S3 endpoint URL for backup storage
aws_s3_backup_bucket: StringAWS S3 bucket name for backup storage
aws_s3_backup_region: StringAWS S3 region for backup storage
database_encryption_key_part_1: StringFirst part of the database encryption key (split for security)
database_encryption_key_part_2: StringSecond part of the database encryption key (split for security)
aws_s3_presigned_url_expiration_seconds: u64Expiration time in seconds for S3 presigned URLs
s3_path_encryption_key: StringEncryption key for S3 path encryption
sentry_dsn: Option<String>Optional Sentry DSN for error tracking
Implementations§
source§impl DarkwingConfig
impl DarkwingConfig
sourcepub fn get_jwt_token_algorithm(&self) -> Result<Algorithm>
pub fn get_jwt_token_algorithm(&self) -> Result<Algorithm>
Converts the JWT algorithm string to the corresponding Algorithm enum value.
sourcepub fn redis_timeout(&self) -> Duration
pub fn redis_timeout(&self) -> Duration
Returns the Redis timeout duration.
sourcepub fn presigned_url_expiration(&self) -> Duration
pub fn presigned_url_expiration(&self) -> Duration
Returns the expiration duration for presigned URLs.
Trait Implementations§
source§impl Args for DarkwingConfig
impl Args for DarkwingConfig
source§fn group_id() -> Option<Id>
fn group_id() -> Option<Id>
ArgGroup::id][crate::ArgGroup::id] for this set of argumentssource§fn augment_args<'b>(__clap_app: Command) -> Command
fn augment_args<'b>(__clap_app: Command) -> Command
source§fn augment_args_for_update<'b>(__clap_app: Command) -> Command
fn augment_args_for_update<'b>(__clap_app: Command) -> Command
Command] so it can instantiate self via
[FromArgMatches::update_from_arg_matches_mut] Read moresource§impl Clone for DarkwingConfig
impl Clone for DarkwingConfig
source§fn clone(&self) -> DarkwingConfig
fn clone(&self) -> DarkwingConfig
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl CommandFactory for DarkwingConfig
impl CommandFactory for DarkwingConfig
source§impl Debug for DarkwingConfig
impl Debug for DarkwingConfig
source§impl Default for DarkwingConfig
impl Default for DarkwingConfig
source§fn default() -> DarkwingConfig
fn default() -> DarkwingConfig
source§impl FromArgMatches for DarkwingConfig
impl FromArgMatches for DarkwingConfig
source§fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>
source§fn from_arg_matches_mut(
__clap_arg_matches: &mut ArgMatches,
) -> Result<Self, Error>
fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>
source§fn update_from_arg_matches(
&mut self,
__clap_arg_matches: &ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>
ArgMatches to self.source§fn update_from_arg_matches_mut(
&mut self,
__clap_arg_matches: &mut ArgMatches,
) -> Result<(), Error>
fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>
ArgMatches to self.source§impl Parser for DarkwingConfig
impl Parser for DarkwingConfig
§fn parse_from<I, T>(itr: I) -> Self
fn parse_from<I, T>(itr: I) -> Self
§fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
§fn update_from<I, T>(&mut self, itr: I)
fn update_from<I, T>(&mut self, itr: I)
§fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error>
fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error>
Auto Trait Implementations§
impl Freeze for DarkwingConfig
impl RefUnwindSafe for DarkwingConfig
impl Send for DarkwingConfig
impl Sync for DarkwingConfig
impl Unpin for DarkwingConfig
impl UnwindSafe for DarkwingConfig
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)§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>
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>
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>
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