ds: add workerstate

This commit is contained in:
realaltffour 2020-06-28 10:49:39 +03:00
parent 7831b15f5f
commit 8e0be31bbe
No known key found for this signature in database
GPG Key ID: C1265D839D44DCB1
4 changed files with 16 additions and 5 deletions

View File

@ -5,8 +5,8 @@ static EXPIY_DATE: DateTime<Utc> = DateTime::<Utc>::from_utc(NaiveDateTime::from
#[derive(PartialEq, Debug)]
pub struct SessionID {
sess_id: String,
client_ip: Ipv4Addr,
expiry_date: DateTime<Utc>,
is_active: bool,
pub sess_id: String,
pub client_ip: Ipv4Addr,
pub expiry_date: DateTime<Utc>,
pub is_active: bool,
}

View File

@ -3,7 +3,7 @@ use crate::ds::server::worker_server::WorkerServer;
use crate::ds::account::session::SessionID;
#[derive(Default, PartialEq, Debug)]
pub struct MasterServer {
pub struct MasterState {
pub worker_servers: Vec<WorkerServer>,
pub active_sessions: Vec<SessionID>,
pub assets_data: HashMap,

View File

@ -1,3 +1,5 @@
use std::next::Ipv4Addr;
#[derive(Default, PartialEq, Debug)]
pub struct WorkerServer {
pub name: String,

View File

@ -0,0 +1,9 @@
use std::next::Ipv4Addr;
use crate::ds::account::session::SessionID;
#[derive(PartialEq, Debug)]
pub struct WorkerState {
pub master_server_ip: Ipv4Addr,
pub sessions: Vec<SessionID>,
}