Add component configs
This commit is contained in:
parent
f4ece4e33d
commit
c336f84af9
3 changed files with 92 additions and 0 deletions
22
backend/sync_server/src/config/user_config.rs
Normal file
22
backend/sync_server/src/config/user_config.rs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
use std::path::Path;
|
||||
|
||||
use anyhow::{Context, Result};
|
||||
use log::debug;
|
||||
use serde::{Deserialize, Serialize};
|
||||
use tokio::fs;
|
||||
|
||||
use crate::{
|
||||
consts::{DEFAULT_HOST, DEFAULT_MAX_CONNECTIONS, DEFAULT_PORT, DEFAULT_SQLITE_URL},
|
||||
errors::SyncServerError,
|
||||
};
|
||||
#[derive(Debug, Deserialize, Serialize, Clone)]
|
||||
pub struct UserConfig {
|
||||
#[serde(default = "Vec::new")]
|
||||
pub users: Vec<User>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Serialize, Clone)]
|
||||
pub struct User {
|
||||
pub name: String,
|
||||
pub token: String,
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue