1 |
use super::Config; |
2 |
use salaryman::service::Service; |
3 |
use schemars::JsonSchema; |
4 |
use serde::{Deserialize, Serialize}; |
5 |
use std::sync::Arc; |
6 |
use tokio::sync::Mutex; |
7 |
|
8 |
pub struct SalarymanDContext { |
9 |
pub config: Config, |
10 |
pub service: Vec<Arc<Mutex<Service>>>, |
11 |
} |
12 |
impl SalarymanDContext { |
13 |
pub fn new() -> Self { |
14 |
Self { |
15 |
config: Config::new(), |
16 |
service: Vec::new(), |
17 |
} |
18 |
} |
19 |
pub fn from_parts(config: Config, service: Vec<Arc<Mutex<Service>>>) -> Self { |
20 |
Self { config, service } |
21 |
} |
22 |
} |
23 |
|
24 |
#[derive(Serialize, Deserialize, JsonSchema, Debug)] |
25 |
pub struct StdinBuffer { |
26 |
pub string: String, |
27 |
} |