use serde::{Deserialize, Serialize};

#[derive(Debug, Serialize, Deserialize)]
pub struct Storage {
    /// Where the repositories are defined.
    #[serde(default)]
    pub repo_file: String,
    /// Where to store pkgs data
    #[serde(default)]
    pub data_dir: String,
    /// Where to store repo indexes
    #[serde(default)]
    pub index_dir: String,
}

impl Default for Storage {
    fn default() -> Self {
        Storage {
            repo_file: String::from("/etc/pkgr.d/repos.toml"),
            data_dir: String::from("/var/lib/pkgr/packages"),
            index_dir: String::from("/var/lib/pkgr/indexes"),
        }
    }
}