summaryrefslogtreecommitdiff
path: root/src/config.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/config.rs')
-rw-r--r--src/config.rs34
1 files changed, 32 insertions, 2 deletions
diff --git a/src/config.rs b/src/config.rs
index 089d3e2..a5652c1 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -1,11 +1,41 @@
-use std::{fs::File, io::{read_to_string}, path::Path};
+use std::{collections::BTreeMap, fs::File, io::read_to_string, path::Path};
+use rss::{Category, Cloud, Image, TextInput, extension::{Extension, dublincore::DublinCoreExtension, itunes::ITunesChannelExtension, syndication::SyndicationExtension}};
use serde::Deserialize;
#[derive(Deserialize)]
pub struct Config {
#[serde(default)]
- pub urls: Vec<String>
+ pub urls: Vec<String>,
+ pub channel: ChannelConfig,
+}
+
+#[derive(Deserialize)]
+pub struct ChannelConfig {
+ pub title: String,
+ pub link: String,
+ pub description: String,
+ pub language: Option<String>,
+ pub copyright: Option<String>,
+ pub managing_editor: Option<String>,
+ pub webmaster: Option<String>,
+ #[serde(default)]
+ pub categories: Vec<Category>,
+ pub cloud: Option<Cloud>,
+ pub ttl: Option<String>,
+ pub image: Option<Image>,
+ pub text_input: Option<TextInput>,
+ #[serde(default)]
+ pub skip_hours: Vec<String>,
+ #[serde(default)]
+ pub skip_days: Vec<String>,
+ #[serde(default)]
+ pub extensions: BTreeMap<String, BTreeMap<String, Vec<Extension>>>,
+ pub itunes_ext: Option<ITunesChannelExtension>,
+ pub dublin_core_ext: Option<DublinCoreExtension>,
+ pub syndication_ext: Option<SyndicationExtension>,
+ #[serde(default)]
+ pub namespaces: BTreeMap<String, String>,
}
pub fn default_config_file_locations() -> Vec<String> {