mirrord/src/config.rs

17 lines
339 B
Rust
Raw Normal View History

2024-04-09 14:30:10 +02:00
use serde::Deserialize;
use crate::proxy::ProxyMirror;
#[derive(Debug, Deserialize)]
pub struct Config {
pub mirrors: Vec<String>,
pub cache_dir: String,
2024-04-10 10:24:56 +02:00
pub no_cache: String,
2024-04-09 14:30:10 +02:00
}
impl Config {
pub fn to_proxy(&self) -> ProxyMirror {
2024-04-10 10:24:56 +02:00
ProxyMirror::new(self.mirrors.clone(), &self.cache_dir, &self.no_cache)
2024-04-09 14:30:10 +02:00
}
}