mirrord/src/config.rs
2024-04-10 10:24:56 +02:00

16 lines
339 B
Rust

use serde::Deserialize;
use crate::proxy::ProxyMirror;
#[derive(Debug, Deserialize)]
pub struct Config {
pub mirrors: Vec<String>,
pub cache_dir: String,
pub no_cache: String,
}
impl Config {
pub fn to_proxy(&self) -> ProxyMirror {
ProxyMirror::new(self.mirrors.clone(), &self.cache_dir, &self.no_cache)
}
}