From 6a10fcaf64938da52b326ea80013d9f30ed62a6c Mon Sep 17 00:00:00 2001 From: Owen Jacobson Date: Sat, 5 Oct 2024 22:42:43 -0400 Subject: Separate `/api/boot` into its own module. --- src/app.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/app.rs') diff --git a/src/app.rs b/src/app.rs index 186e5f8..6d007a9 100644 --- a/src/app.rs +++ b/src/app.rs @@ -1,13 +1,16 @@ use sqlx::sqlite::SqlitePool; use crate::{ + boot::app::Boot, channel::app::Channels, event::{app::Events, broadcaster::Broadcaster as EventBroadcaster}, - login::app::Logins, message::app::Messages, token::{app::Tokens, broadcaster::Broadcaster as TokenBroadcaster}, }; +#[cfg(test)] +use crate::login::app::Logins; + #[derive(Clone)] pub struct App { db: SqlitePool, @@ -24,6 +27,10 @@ impl App { } impl App { + pub const fn boot(&self) -> Boot { + Boot::new(&self.db) + } + pub const fn channels(&self) -> Channels { Channels::new(&self.db, &self.events) } @@ -32,6 +39,7 @@ impl App { Events::new(&self.db, &self.events) } + #[cfg(test)] pub const fn logins(&self) -> Logins { Logins::new(&self.db) } -- cgit v1.2.3