| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
pub mod auth; |
| 11 |
pub mod chat; |
| 12 |
pub mod config; |
| 13 |
pub mod csrf; |
| 14 |
pub mod error_page; |
| 15 |
pub mod internal_auth; |
| 16 |
pub mod link_preview; |
| 17 |
pub mod maintenance; |
| 18 |
pub mod routes; |
| 19 |
pub mod seed; |
| 20 |
pub mod static_assets; |
| 21 |
pub mod storage; |
| 22 |
pub mod templates; |
| 23 |
pub mod tls; |
| 24 |
pub mod trust_store; |
| 25 |
pub mod trusted_proxy; |
| 26 |
|
| 27 |
use config::Config; |
| 28 |
use sqlx::PgPool; |
| 29 |
use std::sync::Arc; |
| 30 |
|
| 31 |
|
| 32 |
#[derive(Clone)] |
| 33 |
pub struct AppState { |
| 34 |
pub db: PgPool, |
| 35 |
pub config: Config, |
| 36 |
pub http: reqwest::Client, |
| 37 |
|
| 38 |
|
| 39 |
pub link_preview: link_preview::LinkPreviewFetcher, |
| 40 |
pub s3: Option<Arc<storage::S3Storage>>, |
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
pub chat: Arc<livechat::Chat>, |
| 47 |
|
| 48 |
|
| 49 |
pub chat_identities: chat::IdentityCache, |
| 50 |
} |
| 51 |
|