pub struct Config {Show 22 fields
pub service: ServiceConfig,
pub ports: PortsConfig,
pub host: HostConfig,
pub modules: ModulesConfig,
pub redis: RedisConfig,
pub database: DatabaseConfig,
pub questdb: QuestDbConfig,
pub forward: ForwardConfig,
pub risk: RiskConfig,
pub backward: BackwardConfig,
pub cns: CnsConfig,
pub market: MarketConfig,
pub assets: AssetsConfig,
pub trading: TradingConfig,
pub logging: LoggingConfig,
pub tracing: TracingConfig,
pub metrics: MetricsConfig,
pub alerting: AlertingConfig,
pub param_reload: ParamReloadConfig,
pub features: FeaturesConfig,
pub security: SecurityConfig,
pub advanced: AdvancedConfig,
}Expand description
Main configuration for the unified JANUS service
Fields§
§service: ServiceConfigService metadata
ports: PortsConfigNetwork ports configuration
host: HostConfigHost/bind configuration
modules: ModulesConfigModule toggles
redis: RedisConfigRedis configuration
database: DatabaseConfigDatabase configuration
questdb: QuestDbConfigQuestDB configuration
forward: ForwardConfigForward module settings
risk: RiskConfigRisk management settings
backward: BackwardConfigBackward module settings
cns: CnsConfigCNS module settings
market: MarketConfigMarket data configuration
assets: AssetsConfigAssets configuration
trading: TradingConfigTrading configuration
logging: LoggingConfigLogging configuration
tracing: TracingConfigTracing configuration
metrics: MetricsConfigMetrics configuration
alerting: AlertingConfigAlerting configuration
param_reload: ParamReloadConfigParameter hot-reload configuration
features: FeaturesConfigFeature engineering configuration
security: SecurityConfigSecurity configuration
advanced: AdvancedConfigAdvanced settings
Implementations§
Source§impl Config
impl Config
Sourcepub fn load() -> Result<Self>
pub fn load() -> Result<Self>
Load configuration from TOML file with environment variable overrides
Priority order (highest to lowest):
- Redis overlay at
fks:janus:config(whenredisfeature enabled and key present) - Environment variables
- TOML config file
- Default values
Sourcepub fn from_file<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn from_file<P: AsRef<Path>>(path: P) -> Result<Self>
Load configuration from a specific TOML file
Sourcepub fn is_production(&self) -> bool
pub fn is_production(&self) -> bool
Check if running in production
Sourcepub fn cors_origins_list(&self) -> Vec<String>
pub fn cors_origins_list(&self) -> Vec<String>
Get CORS origins as a list
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
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