From 143014a91e695106d8383ed173c482b3b4519663 Mon Sep 17 00:00:00 2001 From: Keuin Date: Mon, 4 Sep 2023 01:57:22 +0800 Subject: initial version --- src/config.rs | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/config.rs (limited to 'src/config.rs') diff --git a/src/config.rs b/src/config.rs new file mode 100644 index 0000000..7eee270 --- /dev/null +++ b/src/config.rs @@ -0,0 +1,30 @@ +use serde_derive::{Deserialize, Serialize}; + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct Server { + pub listen: String, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct Service { + pub name: String, + pub addr: String, // host:port +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct Client { + pub addr: String, +} + +#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] +pub struct Root { + pub server: Option, + pub client: Option, + pub service: Vec, + #[serde(default = "default_true")] + pub allow_help: bool, +} + +fn default_true() -> bool { + true +} -- cgit v1.2.3