mirror of
https://github.com/OMGeeky/backup_config.git
synced 2026-01-01 09:10:21 +01:00
add settings for Notifier (webhook & smtp)
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "twba-backup-config"
|
||||
version = "0.1.6"
|
||||
version = "0.1.7"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
25
src/lib.rs
25
src/lib.rs
@@ -20,6 +20,8 @@ pub struct Conf {
|
||||
#[config(default = 5)]
|
||||
pub max_items_to_process: u64,
|
||||
|
||||
#[config(nested)]
|
||||
pub notifier: Notifier,
|
||||
#[config(nested)]
|
||||
pub twitch: Twitch,
|
||||
#[config(nested)]
|
||||
@@ -48,6 +50,29 @@ impl Conf {
|
||||
PathBuf::from(path)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize, Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Config)]
|
||||
pub struct Notifier {
|
||||
/// The URL for the webhook
|
||||
pub webhook_url: Option<String>,
|
||||
pub smtp: Option<Smtp>,
|
||||
}
|
||||
#[derive(Debug, Serialize, Deserialize, Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Config)]
|
||||
pub struct Smtp {
|
||||
/// The SMTP server address
|
||||
pub server: String,
|
||||
/// The SMTP server port
|
||||
pub port: u16,
|
||||
/// The SMTP username
|
||||
pub username: String,
|
||||
/// The SMTP password
|
||||
pub password: String,
|
||||
/// The email address to send the email from
|
||||
pub from: String,
|
||||
/// The email address to send the email to
|
||||
pub to: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize, Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Config)]
|
||||
pub struct Google {
|
||||
/// The path for the auth code file.
|
||||
|
||||
Reference in New Issue
Block a user