diff options
author | Cara Salter <cara@devcara.com> | 2022-07-20 10:31:01 -0400 |
---|---|---|
committer | Cara Salter <cara@devcara.com> | 2022-07-20 10:31:01 -0400 |
commit | 4b616447715b8129ae322341959e1c2bfabbd10e (patch) | |
tree | 01c23c8a5e29d2821cdd1047d0ec27a69f8b1138 /src/models.rs | |
parent | b98646d8501689072f5624483d258adcbf6fc5c5 (diff) | |
download | nccd-4b616447715b8129ae322341959e1c2bfabbd10e.tar.gz nccd-4b616447715b8129ae322341959e1c2bfabbd10e.zip |
emails
also subnet storage
Diffstat (limited to 'src/models.rs')
-rw-r--r-- | src/models.rs | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/models.rs b/src/models.rs index b367f4f..2295154 100644 --- a/src/models.rs +++ b/src/models.rs @@ -1,8 +1,6 @@ -use sqlx::FromRow; +use sqlx::{FromRow, types::ipnetwork::IpNetwork}; - - -#[derive(Debug, FromRow)] +#[derive(Debug, FromRow, Clone)] pub struct DbUser { pub id: String, pub email: String, @@ -10,3 +8,17 @@ pub struct DbUser { 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> +} |