diff options
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs index 0136f94..706effe 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,11 +1,13 @@ pub mod check; -pub mod web; +pub mod log; pub mod mail; +pub mod web; +use ::log::error; use anyhow::{anyhow, Result}; use axum::{routing::get, Router}; use check::check_loop; -use log::error; +use mail::MailConfig; use serde::Deserialize; use std::{ collections::BTreeMap, @@ -16,6 +18,8 @@ use std::{ use tokio::{fs::read_to_string, sync::RwLock}; use web::send_html_page; +pub static GLOBAL_ERROR: RwLock<Option<anyhow::Error>> = RwLock::const_new(None); + #[tokio::main] async fn main() { env_logger::init_from_env("LOG"); @@ -26,6 +30,7 @@ async fn main() { #[derive(Debug, Deserialize)] pub struct Config { + mail: Option<MailConfig>, title: String, bind: SocketAddr, interval: u64, @@ -35,6 +40,7 @@ pub struct Config { #[derive(Debug, Deserialize)] pub struct Service { title: String, + url: Option<String>, checks: Vec<Check>, } |