mirrord/src/config.rs

16 lines
297 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,
}
impl Config {
pub fn to_proxy(&self) -> ProxyMirror {
ProxyMirror::new(self.mirrors.clone(), &self.cache_dir)
}
}