From ce29e0685cab8671cacc8390d9d0377179b1866f Mon Sep 17 00:00:00 2001 From: mbecker20 Date: Sun, 16 Jul 2023 15:38:01 +0000 Subject: [PATCH] move helpers around --- bin/core/src/{ => helpers}/alert.rs | 0 bin/core/src/{ => helpers}/cache.rs | 0 bin/core/src/{ => helpers}/channel.rs | 0 bin/core/src/{ => helpers}/db.rs | 0 bin/core/src/{helpers.rs => helpers/mod.rs} | 5 +++++ bin/core/src/main.rs | 4 ---- bin/core/src/state.rs | 4 +--- 7 files changed, 6 insertions(+), 7 deletions(-) rename bin/core/src/{ => helpers}/alert.rs (100%) rename bin/core/src/{ => helpers}/cache.rs (100%) rename bin/core/src/{ => helpers}/channel.rs (100%) rename bin/core/src/{ => helpers}/db.rs (100%) rename bin/core/src/{helpers.rs => helpers/mod.rs} (99%) diff --git a/bin/core/src/alert.rs b/bin/core/src/helpers/alert.rs similarity index 100% rename from bin/core/src/alert.rs rename to bin/core/src/helpers/alert.rs diff --git a/bin/core/src/cache.rs b/bin/core/src/helpers/cache.rs similarity index 100% rename from bin/core/src/cache.rs rename to bin/core/src/helpers/cache.rs diff --git a/bin/core/src/channel.rs b/bin/core/src/helpers/channel.rs similarity index 100% rename from bin/core/src/channel.rs rename to bin/core/src/helpers/channel.rs diff --git a/bin/core/src/db.rs b/bin/core/src/helpers/db.rs similarity index 100% rename from bin/core/src/db.rs rename to bin/core/src/helpers/db.rs diff --git a/bin/core/src/helpers.rs b/bin/core/src/helpers/mod.rs similarity index 99% rename from bin/core/src/helpers.rs rename to bin/core/src/helpers/mod.rs index 1793e5c3f..ac92d5647 100644 --- a/bin/core/src/helpers.rs +++ b/bin/core/src/helpers/mod.rs @@ -22,6 +22,11 @@ use rand::{thread_rng, Rng}; use crate::{auth::RequestUser, state::State}; +pub mod cache; +pub mod channel; +pub mod alert; +pub mod db; + pub fn empty_or_only_spaces(word: &str) -> bool { if word.is_empty() { return true; diff --git a/bin/core/src/main.rs b/bin/core/src/main.rs index 84f2f3805..0c0de06fd 100644 --- a/bin/core/src/main.rs +++ b/bin/core/src/main.rs @@ -4,13 +4,9 @@ extern crate log; use axum::{Extension, Router}; use termination_signal::tokio::immediate_term_handle; -mod alert; mod auth; -mod cache; -mod channel; mod cloud; mod config; -mod db; mod helpers; mod listener; mod monitor; diff --git a/bin/core/src/state.rs b/bin/core/src/state.rs index 377cc9154..511ccb6fb 100644 --- a/bin/core/src/state.rs +++ b/bin/core/src/state.rs @@ -12,10 +12,8 @@ use monitor_types::{ use crate::{ auth::{GithubOauthClient, GoogleOauthClient, JwtClient}, - cache::Cache, - channel::BroadcastChannel, config::{CoreConfig, Env}, - db::DbClient, + helpers::{cache::Cache, channel::BroadcastChannel, db::DbClient}, monitor::{CachedDeploymentStatus, CachedServerStatus}, };