diff options
Diffstat (limited to 'src/config.rs')
-rw-r--r-- | src/config.rs | 30 |
1 files changed, 30 insertions, 0 deletions
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<Server>, + pub client: Option<Client>, + pub service: Vec<Service>, + #[serde(default = "default_true")] + pub allow_help: bool, +} + +fn default_true() -> bool { + true +} |