From 500a0ae5b7501ea4fbfba16e3c81b08b07521382 Mon Sep 17 00:00:00 2001 From: Evie Viau Date: Tue, 25 Jul 2023 01:29:04 -0400 Subject: [PATCH] Add slop constants --- slop-common/src/lib.rs | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/slop-common/src/lib.rs b/slop-common/src/lib.rs index e3bab98..e91c1f4 100644 --- a/slop-common/src/lib.rs +++ b/slop-common/src/lib.rs @@ -1,6 +1,21 @@ pub mod db; +pub const SLOP_VERSION: &str = env!("CARGO_PKG_VERSION"); + +#[derive(Clone)] pub struct SlopState { - conn: sea_orm::DatabaseConnection, - nats_client: async_nats::Client, + pub conn: sea_orm::DatabaseConnection, + pub nats_client: async_nats::Client, } + +// Constants +// Some of these may be moved to the db config at some point in the future +pub const MAX_FEATURED_TAGS: i64 = 4; +pub const CHARACTERS_RESERVED_PER_URL: i64 = 23; +pub const IMAGE_MATRIX_LIMIT: i64 = 999998000001; +pub const VIDEO_MATRIX_LIMIT: i64 = 999998000001; +pub const VIDEO_FRAME_RATE_LIMIT: i64 = 999998000001; +pub const POLLS_MAX_OPTIONS: i64 = 4; +pub const POLLS_MAX_CHARACTERS_PER_OPTION: i64 = 0; +pub const POLLS_MIN_EXPIRATION: i64 = 0; +pub const POLLS_MAX_EXPIRATION: i64 = 0; \ No newline at end of file