summaryrefslogtreecommitdiffstats
path: root/src/state.rs
blob: 508aaa42f0eba12291d7264e96c8cb7b06781c30 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use sqlx::{Pool, Postgres};

#[derive(Debug)]
pub struct AppState {
    pub pool: Pool<Postgres>,
    pub jwt_secret: String,
    pub jwt_max_age: time::Duration,
}

impl AppState {
    pub fn new(pool: Pool<Postgres>, jwt_secret: String, jwt_max_age: time::Duration) -> Self {
        Self {
            pool,
            jwt_secret,
            jwt_max_age,
        }
    }
}