add config structs
This commit is contained in:
31
src/config.rs
Normal file
31
src/config.rs
Normal file
@@ -0,0 +1,31 @@
|
||||
use eui48::MacAddress;
|
||||
use serde::{Deserialize, self};
|
||||
use std::{collections::HashMap, net::IpAddr};
|
||||
|
||||
#[derive(Deserialize)]
|
||||
struct BotConfig {
|
||||
pub auth: BotUserAuthConfig,
|
||||
pub machines: HashMap<String, BotTargetMachineConfig>,
|
||||
#[serde(rename = "deltaChat")]
|
||||
pub delta_chat: BotDeltaChatConfig,
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
struct BotUserAuthConfig {
|
||||
pub password: String,
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
struct BotTargetMachineConfig {
|
||||
#[serde(rename = "default")]
|
||||
is_default: bool,
|
||||
mac: MacAddress,
|
||||
#[serde(rename = "staticIp")]
|
||||
static_ip: IpAddr,
|
||||
}
|
||||
|
||||
#[derive(Deserialize)]
|
||||
struct BotDeltaChatConfig {
|
||||
email: String,
|
||||
password: String,
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
|
||||
mod config;
|
||||
|
||||
fn main() {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user