First set of changes to use config file instead of hard-coded settings.

This commit is contained in:
2026-05-23 11:25:41 +01:00
parent 391380040e
commit 74aa9e8a84
6 changed files with 85 additions and 19 deletions
+19 -1
View File
@@ -1,11 +1,29 @@
use std::collections::{HashMap, HashSet};
use gtfs_structures::{Agency, Calendar, CalendarDate, RawStopTime, RawTrip, Route, Stop};
// This is to store the preferences for the GTFS(-R) side of the code.
#[derive(Debug, PartialEq, Serialize, Deserialize)]
pub struct Preferences {
#[serde(rename = "routes")]
pub route_numbers: HashSet<String>,
#[serde(rename = "stops")]
pub stop_codes: HashSet<String>,
#[serde(rename = "data-folder")]
pub data_folder: String,
#[serde(rename = "gtfs-url")]
pub gtfs_url: String,
#[serde(rename = "realtime-url")]
pub realtime_url: String,
#[serde(rename = "realtime-api-key")]
pub realtime_api_key: String,
#[serde(rename = "refresh-seconds")]
pub refresh_seconds: u32,
}