reddit-magnet/src/notifications/ntfy/config.rs

30 lines
738 B
Rust

use crate::app::Enableable;
use serde::{Deserialize, Serialize};
/// Configuration for the ntfy notification service
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct NtfyConfig {
/// Whether to enable the ntfy notification service
#[serde(default)]
pub enable: bool,
/// The host URL of the ntfy server
pub host: String,
/// The username for authentication (optional)
#[serde(default)]
pub username: Option<String>,
/// The password for authentication (optional)
#[serde(default)]
pub password: Option<String>,
/// The topic to publish notifications to
pub topic: String,
}
impl Enableable for NtfyConfig {
fn is_enabled(&self) -> bool {
self.enable
}
}