diff options
author | Hristo Venev <hristo@venev.name> | 2019-09-28 16:21:28 +0000 |
---|---|---|
committer | Hristo Venev <hristo@venev.name> | 2019-09-28 16:22:07 +0000 |
commit | 8e6318f29eb022126e82e0c084262c77d9ee3300 (patch) | |
tree | 0a6d8a88e1e1f96daff61e1d19b144f93aa8f256 /src/config.rs | |
parent | 3a5552509439612accf579becc7cb85a596bd466 (diff) |
Implement peer overrides.
Diffstat (limited to 'src/config.rs')
-rw-r--r-- | src/config.rs | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/config.rs b/src/config.rs index ccdb042..08db0eb 100644 --- a/src/config.rs +++ b/src/config.rs @@ -20,11 +20,20 @@ pub struct Source { #[serde(deny_unknown_fields)] #[derive(serde_derive::Serialize, serde_derive::Deserialize, Clone, PartialEq, Eq, Debug)] +pub struct Peer { + pub source: Option<String>, + pub psk: Option<Key>, +} + +#[serde(deny_unknown_fields)] +#[derive(serde_derive::Serialize, serde_derive::Deserialize, Clone, PartialEq, Eq, Debug)] pub struct GlobalConfig { #[serde(default = "default_min_keepalive")] pub min_keepalive: u32, #[serde(default = "default_max_keepalive")] pub max_keepalive: u32, + #[serde(rename = "peer")] + pub peers: HashMap<Key, Peer>, } impl Default for GlobalConfig { @@ -33,6 +42,7 @@ impl Default for GlobalConfig { Self { min_keepalive: default_min_keepalive(), max_keepalive: default_max_keepalive(), + peers: HashMap::new(), } } } @@ -72,7 +82,7 @@ impl Default for UpdaterConfig { #[serde(deny_unknown_fields)] #[derive(serde_derive::Serialize, serde_derive::Deserialize, Default, Clone, Debug)] pub struct Config { - pub runtime_directory: Option<PathBuf>, + pub state_directory: Option<PathBuf>, #[serde(flatten)] pub global: GlobalConfig, |