aboutsummaryrefslogtreecommitdiff
path: root/src/utils/data.rs
diff options
context:
space:
mode:
authornotgne22021-01-08 18:24:04 -0700
committernotgne22021-01-08 18:24:04 -0700
commit70c55363a91572790ba5d49b70c58040f112e55c (patch)
tree3344ef89b6d33cfd7e831a77941de2d29635919a /src/utils/data.rs
parentaa42daa8002f17c33a0a56abc110ca1bc14e8cc2 (diff)
Restructure project
Diffstat (limited to 'src/utils/data.rs')
-rw-r--r--src/utils/data.rs73
1 files changed, 0 insertions, 73 deletions
diff --git a/src/utils/data.rs b/src/utils/data.rs
deleted file mode 100644
index f557e41..0000000
--- a/src/utils/data.rs
+++ /dev/null
@@ -1,73 +0,0 @@
-// SPDX-FileCopyrightText: 2020 Serokell <https://serokell.io/>
-//
-// SPDX-License-Identifier: MPL-2.0
-
-use merge::Merge;
-
-use std::collections::HashMap;
-
-#[derive(Deserialize, Debug, Clone, Merge)]
-pub struct GenericSettings {
- #[serde(rename(deserialize = "sshUser"))]
- pub ssh_user: Option<String>,
- pub user: Option<String>,
- #[serde(
- skip_serializing_if = "Vec::is_empty",
- default,
- rename(deserialize = "sshOpts")
- )]
- #[merge(strategy = merge::vec::append)]
- pub ssh_opts: Vec<String>,
- #[serde(rename(deserialize = "fastConnection"))]
- pub fast_connection: Option<bool>,
- #[serde(rename(deserialize = "autoRollback"))]
- pub auto_rollback: Option<bool>,
- #[serde(rename(deserialize = "confirmTimeout"))]
- pub confirm_timeout: Option<u16>,
- #[serde(rename(deserialize = "tempPath"))]
- pub temp_path: Option<String>,
- #[serde(rename(deserialize = "magicRollback"))]
- pub magic_rollback: Option<bool>,
-}
-
-#[derive(Deserialize, Debug, Clone)]
-pub struct NodeSettings {
- pub hostname: String,
- pub profiles: HashMap<String, Profile>,
- #[serde(
- skip_serializing_if = "Vec::is_empty",
- default,
- rename(deserialize = "profilesOrder")
- )]
- pub profiles_order: Vec<String>,
-}
-
-#[derive(Deserialize, Debug, Clone)]
-pub struct ProfileSettings {
- pub path: String,
- #[serde(rename(deserialize = "profilePath"))]
- pub profile_path: Option<String>,
-}
-
-#[derive(Deserialize, Debug, Clone)]
-pub struct Profile {
- #[serde(flatten)]
- pub profile_settings: ProfileSettings,
- #[serde(flatten)]
- pub generic_settings: GenericSettings,
-}
-
-#[derive(Deserialize, Debug, Clone)]
-pub struct Node {
- #[serde(flatten)]
- pub generic_settings: GenericSettings,
- #[serde(flatten)]
- pub node_settings: NodeSettings,
-}
-
-#[derive(Deserialize, Debug, Clone)]
-pub struct Data {
- #[serde(flatten)]
- pub generic_settings: GenericSettings,
- pub nodes: HashMap<String, Node>,
-}