feat: validate configuration
This commit is contained in:
parent
ee7d7971be
commit
48c670f455
33 changed files with 1076 additions and 165 deletions
|
|
@ -1,4 +1,5 @@
|
|||
use crate::app::Enableable;
|
||||
use crate::config::types::{Host, Password, Topic, Username};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
/// Configuration for the ntfy notification service
|
||||
|
|
@ -9,18 +10,18 @@ pub struct NtfyConfig {
|
|||
pub enable: bool,
|
||||
|
||||
/// The host URL of the ntfy server
|
||||
pub host: String,
|
||||
pub host: Host,
|
||||
|
||||
/// The username for authentication (optional)
|
||||
#[serde(default)]
|
||||
pub username: Option<String>,
|
||||
pub username: Option<Username>,
|
||||
|
||||
/// The password for authentication (optional)
|
||||
#[serde(default)]
|
||||
pub password: Option<String>,
|
||||
pub password: Option<Password>,
|
||||
|
||||
/// The topic to publish notifications to
|
||||
pub topic: String,
|
||||
pub topic: Topic,
|
||||
}
|
||||
|
||||
impl Enableable for NtfyConfig {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue