X-Git-Url: http://git.euphorik.ch/?a=blobdiff_plain;f=src%2Fconfig.rs;h=d8a13d9fbaa75029901656b564a186c1ab1f4bc7;hb=e442b05740651836d1f250f1471518800e1a9e6e;hp=e3b1309555b508c1032bf40e05be402c3218e879;hpb=14192169c496bbd090f85a7e308817e6e6027aed;p=gandi_dns_update.git diff --git a/src/config.rs b/src/config.rs index e3b1309..d8a13d9 100644 --- a/src/config.rs +++ b/src/config.rs @@ -1,6 +1,7 @@ -use ron::{ de::from_reader, ser::to_writer }; -use serde::{ Deserialize, Serialize }; -use std::{ fs::File, time }; +use std::{fs::File, time}; + +use ron::{de::from_reader, ser::to_writer}; +use serde::{Deserialize, Serialize}; use crate::error::Result; @@ -8,14 +9,18 @@ use crate::error::Result; pub struct Config { pub delay_between_check: time::Duration, pub api_key: String, - pub fqdn: String, - pub domains: Vec, - pub ttl: i32 + pub domains: Vec<(String, String)>, // Hostname, domain. + pub ttl: i32, } impl Config { pub fn default() -> Self { - Config { delay_between_check: time::Duration::from_secs(120), api_key: String::from(""), fqdn: String::from(""), domains: Vec::new(), ttl: 300 } + Config { + delay_between_check: time::Duration::from_secs(120), + api_key: String::from(""), + domains: Vec::new(), + ttl: 300, + } } pub fn read(file_path: &str) -> Result { @@ -30,4 +35,4 @@ impl Config { } } } -} \ No newline at end of file +}