Web-based Calendar Aggregator
https://ticker.c3d2.de/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
575 B
24 lines
575 B
use std::fs::read_to_string; |
|
use std::collections::BTreeMap; |
|
use serde::{Serialize, Deserialize}; |
|
|
|
|
|
#[derive(Debug, PartialEq, Serialize, Deserialize)] |
|
pub struct CalendarOptions { |
|
pub url: String, |
|
} |
|
|
|
#[derive(Debug, PartialEq, Serialize, Deserialize)] |
|
pub struct Config { |
|
pub db_url: String, |
|
pub calendars: BTreeMap<String, CalendarOptions>, |
|
} |
|
|
|
impl Config { |
|
pub fn read_yaml_file(path: &str) -> Self { |
|
let config_file = read_to_string(path) |
|
.expect(path); |
|
serde_yaml::from_str(&config_file) |
|
.expect("config") |
|
} |
|
}
|
|
|