summaryrefslogtreecommitdiff
path: root/src/config.rs
diff options
context:
space:
mode:
authorFxQnLr <[email protected]>2024-03-04 21:59:50 +0100
committerFxQnLr <[email protected]>2024-03-04 21:59:50 +0100
commit85c63c2ca8448428e2db93cb9d4f284a4e314ed7 (patch)
tree0180a452dd354b067470618e6dbdc330649287cb /src/config.rs
parent0a058ba2064d323451462a79c71580dea7d8ec8c (diff)
downloadwebol-85c63c2ca8448428e2db93cb9d4f284a4e314ed7.tar
webol-85c63c2ca8448428e2db93cb9d4f284a4e314ed7.tar.gz
webol-85c63c2ca8448428e2db93cb9d4f284a4e314ed7.zip
#20. Set offset manually through config
Diffstat (limited to 'src/config.rs')
-rw-r--r--src/config.rs2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/config.rs b/src/config.rs
index 58043c2..9605361 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -8,6 +8,7 @@ pub struct Config {
8 pub serveraddr: String, 8 pub serveraddr: String,
9 pub pingtimeout: i64, 9 pub pingtimeout: i64,
10 pub pingthreshold: i64, 10 pub pingthreshold: i64,
11 pub timeoffset: i8,
11} 12}
12 13
13impl Config { 14impl Config {
@@ -16,6 +17,7 @@ impl Config {
16 .set_default("serveraddr", "0.0.0.0:7229")? 17 .set_default("serveraddr", "0.0.0.0:7229")?
17 .set_default("pingtimeout", 10)? 18 .set_default("pingtimeout", 10)?
18 .set_default("pingthreshold", 1)? 19 .set_default("pingthreshold", 1)?
20 .set_default("timeoffset", 0)?
19 .add_source(File::with_name("config.toml").required(false)) 21 .add_source(File::with_name("config.toml").required(false))
20 .add_source(File::with_name("config.dev.toml").required(false)) 22 .add_source(File::with_name("config.dev.toml").required(false))
21 .add_source(config::Environment::with_prefix("WEBOL").prefix_separator("_")) 23 .add_source(config::Environment::with_prefix("WEBOL").prefix_separator("_"))