add config structs

This commit is contained in:
2026-03-18 00:35:59 +03:00
parent 56856b480b
commit e05a94f168
4 changed files with 53 additions and 1 deletions

31
src/config.rs Normal file
View 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,
}

View File

@@ -1,4 +1,4 @@
mod config;
fn main() {