1use crate::model::{Env, EnvId, Vm, VmId};
8use lazy_static::lazy_static;
9use parking_lot::RwLock;
10use std::{
11 collections::{HashMap, HashSet},
12 sync::Arc,
13};
14
15lazy_static! {
16 pub static ref SERV: Arc<Service> = Arc::new(Service::default());
18}
19
20pub type UserId = String;
22
23#[derive(Default)]
25pub struct Service {
26 #[allow(missing_docs)]
27 pub user_to_env: Arc<RwLock<HashMap<UserId, HashSet<EnvId>>>>,
28 #[allow(missing_docs)]
29 pub all_env: Arc<RwLock<HashMap<EnvId, Env>>>,
30 #[allow(missing_docs)]
31 pub all_vm: Arc<RwLock<HashMap<VmId, Vm>>>,
32}