diff options
author | Stuart Stock <stuart@int08h.com> | 2018-10-22 20:35:36 -0500 |
---|---|---|
committer | Stuart Stock <stuart@int08h.com> | 2018-10-22 20:35:36 -0500 |
commit | bed4ed8e8db78434a77bb112a59c360f8f9eb803 (patch) | |
tree | a0a1cca35d90a1ee1823491a8c1ffcf9e1a8ae3f /src/config/file.rs | |
parent | 2225b7c4ecb40cef0c9bf6b4d50b48c0009e6e6a (diff) | |
download | roughenough-bed4ed8e8db78434a77bb112a59c360f8f9eb803.zip |
groundwork for TCP healthcheck in #8
Diffstat (limited to 'src/config/file.rs')
-rw-r--r-- | src/config/file.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/config/file.rs b/src/config/file.rs index b1e856b..b70392d 100644 --- a/src/config/file.rs +++ b/src/config/file.rs @@ -43,6 +43,7 @@ pub struct FileConfig { batch_size: u8, status_interval: Duration, key_protection: KeyProtection, + health_check_port: Option<u16>, } impl FileConfig { @@ -69,6 +70,7 @@ impl FileConfig { batch_size: DEFAULT_BATCH_SIZE, status_interval: DEFAULT_STATUS_INTERVAL, key_protection: KeyProtection::Plaintext, + health_check_port: None, }; for (key, value) in cfg[0].as_hash().unwrap() { @@ -93,6 +95,10 @@ impl FileConfig { .unwrap_or_else(|_| panic!("invalid key_protection value: {:?}", value)); config.key_protection = val } + "health_check_port" => { + let val = value.as_i64().unwrap() as u16; + config.health_check_port = Some(val); + } unknown => { return Err(Error::InvalidConfiguration(format!( "unknown config key: {}", @@ -130,4 +136,8 @@ impl ServerConfig for FileConfig { fn key_protection(&self) -> &KeyProtection { &self.key_protection } + + fn health_check_port(&self) -> Option<u16> { + self.health_check_port + } } |