Message store

This commit is contained in:
2026-08-19 21:23:37 +02:00
parent acf1ea91a3
commit 8539b66cd0
6 changed files with 220 additions and 1 deletions
+4 -1
View File
@@ -1,5 +1,6 @@
use std::{
collections::HashMap,
path::PathBuf,
sync::{Arc, atomic::AtomicU16},
};
@@ -11,7 +12,7 @@ use ed25519_dalek::{SigningKey, VerifyingKey};
use tokio::sync::Mutex;
use crate::{
data::config::Config,
data::{config::Config, messages::MessageStore},
protocol::{ClientMethod, read_loop, send_socket},
types::ClientMeta,
};
@@ -27,6 +28,7 @@ pub struct Server {
pub key: SigningKey,
pub config: Config,
pub clients: Mutex<HashMap<VerifyingKey, UserConnections>>,
pub message_store: MessageStore,
}
impl Server {
@@ -35,6 +37,7 @@ impl Server {
key: crate::signature::get().await?,
config: Config::get().await?,
clients: Mutex::new(HashMap::new()),
message_store: MessageStore::new(PathBuf::from("item"))?,
}))
}
}