blob: c006cb00bb55951c5cf11758676df872df7857b9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
#[cfg(feature = "oauth")]
pub mod auth;
use async_trait::async_trait;
use sqlx::PgPool;
use crate::{config::DatabaseOptions, server::state::database};
pub struct Services {
database: PgPool,
// oauth: OauthClient,
}
impl Services {
pub async fn new(database: &DatabaseOptions) -> anyhow::Result<Self> {
let database = database::connect(database).await?;
Ok(Self { database })
}
}
#[async_trait]
pub trait SellershutDriver: Send + Sync + 'static {
async fn hello(&self);
}
#[async_trait]
impl SellershutDriver for Services {
async fn hello(&self) {
todo!()
}
}
|