Skip to main content

ave_bridge/
config.rs

1use ave_core::config::{Config as AveConfig, LoggingConfig, SinkConfig};
2use serde::{Deserialize, Serialize};
3use std::path::PathBuf;
4
5use crate::{auth::AuthConfig, http::HttpConfig};
6
7#[derive(Deserialize, Serialize, Debug, Clone)]
8#[serde(default)]
9pub struct Config {
10    /// Settings from Ave Base.
11    pub node: AveConfig,
12    /// Path for encrypted keys.
13    pub keys_path: PathBuf,
14    /// Logging parameters.
15    pub logging: LoggingConfig,
16    /// Sink parameters.
17    pub sink: SinkConfig,
18    /// Authentication configuration.
19    pub auth: AuthConfig,
20    /// HTTP server configuration.
21    pub http: HttpConfig,
22}
23
24impl Default for Config {
25    fn default() -> Self {
26        Self {
27            node: Default::default(),
28            keys_path: PathBuf::from("keys"),
29            logging: Default::default(),
30            sink: Default::default(),
31            auth: Default::default(),
32            http: Default::default(),
33        }
34    }
35}