summaryrefslogtreecommitdiffstats
path: root/src/config.rs
blob: fde6c1ec3adf8b3bb70b273c20cb298bc5f54ba3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
use url::Url;

#[derive(Debug, Serialize, Deserialize)]
pub struct Configuration {
    #[serde(with = "url_serde")]
    #[serde(rename = "repology_url")]
    repology_url: Url,

    #[serde(rename = "whitelist")]
    whitelist: Vec<String>,

    #[serde(rename = "blacklist")]
    blacklist: Vec<String>,
}

impl Configuration {
    pub fn repology_url(&self) -> &Url {
        &self.repology_url
    }

    pub fn whitelist(&self) -> &Vec<String> {
        &self.whitelist
    }

    pub fn blacklist(&self) -> &Vec<String> {
        &self.blacklist
    }

}