aboutsummaryrefslogtreecommitdiff
path: root/src/models.rs
blob: 22951549edb433c36251b51dd2afe5b1ea97ef37 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use sqlx::{FromRow, types::ipnetwork::IpNetwork};

#[derive(Debug, FromRow, Clone)]
pub struct DbUser {
    pub id: String,
    pub email: String,
    pub pref_name: String,
    pub pw_hash: String,
    pub last_login: chrono::NaiveDateTime
}

#[derive(Debug, FromRow, Clone)]
pub struct Peer {
    pub id: String,
    pub addr: IpNetwork,
    pub public_key: String,
}

#[derive(Debug, FromRow, Clone)]
pub struct Network {
    pub id: String,
    pub subnet: IpNetwork,
    pub description: Option<String>
}