aboutsummaryrefslogtreecommitdiff
path: root/src/config.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/config.rs')
-rw-r--r--src/config.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/config.rs b/src/config.rs
index 4319ffc..9605361 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -7,6 +7,8 @@ pub struct Config {
7 pub apikey: String, 7 pub apikey: String,
8 pub serveraddr: String, 8 pub serveraddr: String,
9 pub pingtimeout: i64, 9 pub pingtimeout: i64,
10 pub pingthreshold: i64,
11 pub timeoffset: i8,
10} 12}
11 13
12impl Config { 14impl Config {
@@ -14,6 +16,8 @@ impl Config {
14 let config = config::Config::builder() 16 let config = config::Config::builder()
15 .set_default("serveraddr", "0.0.0.0:7229")? 17 .set_default("serveraddr", "0.0.0.0:7229")?
16 .set_default("pingtimeout", 10)? 18 .set_default("pingtimeout", 10)?
19 .set_default("pingthreshold", 1)?
20 .set_default("timeoffset", 0)?
17 .add_source(File::with_name("config.toml").required(false)) 21 .add_source(File::with_name("config.toml").required(false))
18 .add_source(File::with_name("config.dev.toml").required(false)) 22 .add_source(File::with_name("config.dev.toml").required(false))
19 .add_source(config::Environment::with_prefix("WEBOL").prefix_separator("_")) 23 .add_source(config::Environment::with_prefix("WEBOL").prefix_separator("_"))
@@ -22,4 +26,3 @@ impl Config {
22 config.try_deserialize() 26 config.try_deserialize()
23 } 27 }
24} 28}
25