mirror of
https://github.com/moghtech/komodo.git
synced 2026-03-11 17:44:19 -05:00
0.1.13 improve Builder structs with defaults
This commit is contained in:
94
Cargo.lock
generated
94
Cargo.lock
generated
@@ -398,7 +398,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "core"
|
||||
version = "0.1.12"
|
||||
version = "0.1.13"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async_timing_util",
|
||||
@@ -414,8 +414,8 @@ dependencies = [
|
||||
"hex",
|
||||
"hmac",
|
||||
"jwt",
|
||||
"monitor_helpers 0.1.11",
|
||||
"monitor_types 0.1.11",
|
||||
"monitor_helpers 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"monitor_types 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"mungos",
|
||||
"periphery_client",
|
||||
"serde",
|
||||
@@ -650,10 +650,10 @@ checksum = "23d8666cb01533c39dde32bcbab8e227b4ed6679b2c925eba05feabea39508fb"
|
||||
|
||||
[[package]]
|
||||
name = "db_client"
|
||||
version = "0.1.12"
|
||||
version = "0.1.13"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"monitor_types 0.1.11",
|
||||
"monitor_types 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"mungos",
|
||||
]
|
||||
|
||||
@@ -1489,17 +1489,17 @@ dependencies = [
|
||||
"serde_derive",
|
||||
"strum",
|
||||
"strum_macros",
|
||||
"toml",
|
||||
"toml 0.6.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "monitor_client"
|
||||
version = "0.1.12"
|
||||
version = "0.1.13"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"envy",
|
||||
"futures-util",
|
||||
"monitor_types 0.1.11",
|
||||
"monitor_types 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"reqwest",
|
||||
"serde",
|
||||
"serde_derive",
|
||||
@@ -1511,9 +1511,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "monitor_helpers"
|
||||
version = "0.1.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "63b1ff7bac3697e1fc06044b669b029964b11182483ce3066e3996c5c0f66b57"
|
||||
version = "0.1.13"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async_timing_util",
|
||||
@@ -1521,18 +1519,20 @@ dependencies = [
|
||||
"bollard",
|
||||
"futures",
|
||||
"futures-util",
|
||||
"monitor_types 0.1.11",
|
||||
"monitor_types 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand",
|
||||
"run_command",
|
||||
"serde",
|
||||
"serde_derive",
|
||||
"serde_json",
|
||||
"toml",
|
||||
"toml 0.7.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "monitor_helpers"
|
||||
version = "0.1.12"
|
||||
version = "0.1.13"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "18f2da95218988b1f18ff704cdc4c7f8bc026a891bb58249b177ac390fad380b"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async_timing_util",
|
||||
@@ -1540,18 +1540,18 @@ dependencies = [
|
||||
"bollard",
|
||||
"futures",
|
||||
"futures-util",
|
||||
"monitor_types 0.1.11",
|
||||
"monitor_types 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"rand",
|
||||
"run_command",
|
||||
"serde",
|
||||
"serde_derive",
|
||||
"serde_json",
|
||||
"toml",
|
||||
"toml 0.7.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "monitor_periphery"
|
||||
version = "0.1.12"
|
||||
version = "0.1.13"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async_timing_util",
|
||||
@@ -1562,8 +1562,8 @@ dependencies = [
|
||||
"dotenv",
|
||||
"envy",
|
||||
"futures-util",
|
||||
"monitor_helpers 0.1.11",
|
||||
"monitor_types 0.1.11",
|
||||
"monitor_helpers 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"monitor_types 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"run_command",
|
||||
"serde",
|
||||
"serde_derive",
|
||||
@@ -1571,15 +1571,13 @@ dependencies = [
|
||||
"sysinfo",
|
||||
"tokio",
|
||||
"tokio-util",
|
||||
"toml",
|
||||
"toml 0.6.0",
|
||||
"tower",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "monitor_types"
|
||||
version = "0.1.11"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "31a6a8d9bf88d5f6f0ede8d35efa7b7018ebf4b62cf7b9d052c18eed185ca805"
|
||||
version = "0.1.13"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"bollard",
|
||||
@@ -1596,7 +1594,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "monitor_types"
|
||||
version = "0.1.12"
|
||||
version = "0.1.13"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d83e58b5ef3f36f51df7ca15ed85a9ab206d4311d02d4dbd6393d7902fd15992"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"bollard",
|
||||
@@ -1855,12 +1855,12 @@ checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e"
|
||||
|
||||
[[package]]
|
||||
name = "periphery_client"
|
||||
version = "0.1.12"
|
||||
version = "0.1.13"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"futures-util",
|
||||
"monitor_helpers 0.1.11",
|
||||
"monitor_types 0.1.11",
|
||||
"monitor_helpers 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"monitor_types 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"reqwest",
|
||||
"serde",
|
||||
"serde_json",
|
||||
@@ -2701,8 +2701,20 @@ checksum = "4fb9d890e4dc9298b70f740f615f2e05b9db37dce531f6b24fb77ac993f9f217"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"serde_spanned",
|
||||
"toml_datetime",
|
||||
"toml_edit",
|
||||
"toml_datetime 0.5.1",
|
||||
"toml_edit 0.18.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "toml"
|
||||
version = "0.7.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "2f560bc7fb3eb31f5eee1340c68a2160cad39605b7b9c9ec32045ddbdee13b85"
|
||||
dependencies = [
|
||||
"serde",
|
||||
"serde_spanned",
|
||||
"toml_datetime 0.6.0",
|
||||
"toml_edit 0.19.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -2714,6 +2726,15 @@ dependencies = [
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "toml_datetime"
|
||||
version = "0.6.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "886f31a9b85b6182cabd4d8b07df3b451afcc216563748201490940d2a28ed36"
|
||||
dependencies = [
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "toml_edit"
|
||||
version = "0.18.0"
|
||||
@@ -2724,7 +2745,20 @@ dependencies = [
|
||||
"nom8",
|
||||
"serde",
|
||||
"serde_spanned",
|
||||
"toml_datetime",
|
||||
"toml_datetime 0.5.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "toml_edit"
|
||||
version = "0.19.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "233d8716cdc5d20ec88a18a839edaf545edc71efa4a5ff700ef4a102c26cd8fa"
|
||||
dependencies = [
|
||||
"indexmap",
|
||||
"nom8",
|
||||
"serde",
|
||||
"serde_spanned",
|
||||
"toml_datetime 0.6.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "core"
|
||||
version = "0.1.12"
|
||||
version = "0.1.13"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
@@ -8,8 +8,8 @@ edition = "2021"
|
||||
[dependencies]
|
||||
# helpers = { package = "monitor_helpers", path = "../lib/helpers" }
|
||||
# types = { package = "monitor_types", path = "../lib/types" }
|
||||
helpers = { package = "monitor_helpers", version = "0.1.11" }
|
||||
types = { package = "monitor_types", version = "0.1.11" }
|
||||
helpers = { package = "monitor_helpers", version = "0.1.13" }
|
||||
types = { package = "monitor_types", version = "0.1.13" }
|
||||
db = { package = "db_client", path = "../lib/db_client" }
|
||||
periphery = { package = "periphery_client", path = "../lib/periphery_client" }
|
||||
axum_oauth2 = { path = "../lib/axum_oauth2" }
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
[package]
|
||||
name = "db_client"
|
||||
version = "0.1.12"
|
||||
version = "0.1.13"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
types = { package = "monitor_types", version = "0.1.11" }
|
||||
types = { package = "monitor_types", version = "0.1.13" }
|
||||
# types = { package = "monitor_types", path = "../types" }
|
||||
mungos = "0.3.0"
|
||||
anyhow = "1.0"
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "monitor_helpers"
|
||||
version = "0.1.12"
|
||||
version = "0.1.13"
|
||||
edition = "2021"
|
||||
authors = ["MoghTech"]
|
||||
description = "helpers used as dependency for mogh tech monitor"
|
||||
@@ -10,7 +10,7 @@ license = "GPL-3.0-or-later"
|
||||
|
||||
[dependencies]
|
||||
# types = { package = "monitor_types", path = "../types" }
|
||||
types = { package = "monitor_types", version = "0.1.11" }
|
||||
types = { package = "monitor_types", version = "0.1.13" }
|
||||
async_timing_util = "0.1.14"
|
||||
bollard = "0.13"
|
||||
anyhow = "1.0"
|
||||
@@ -18,7 +18,7 @@ axum = { version = "0.6", features = ["ws", "json"] }
|
||||
serde = "1.0"
|
||||
serde_derive = "1.0"
|
||||
serde_json = "1.0"
|
||||
toml = "0.6"
|
||||
toml = "0.7"
|
||||
run_command = { version = "0.0.5", features = ["async_tokio"] }
|
||||
rand = "0.8"
|
||||
futures = "0.3"
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "monitor_client"
|
||||
version = "0.1.12"
|
||||
version = "0.1.13"
|
||||
edition = "2021"
|
||||
authors = ["MoghTech"]
|
||||
description = "a client to interact with the monitor system"
|
||||
@@ -9,7 +9,7 @@ license = "GPL-3.0-or-later"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
monitor_types = "0.1.11"
|
||||
monitor_types = "0.1.13"
|
||||
# monitor_types = { path = "../types" }
|
||||
reqwest = { version = "0.11", features = ["json"] }
|
||||
tokio-tungstenite = { version = "0.18", features=["native-tls"] }
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
[package]
|
||||
name = "periphery_client"
|
||||
version = "0.1.12"
|
||||
version = "0.1.13"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
||||
helpers = { package = "monitor_helpers", version = "0.1.11" }
|
||||
types = { package = "monitor_types", version = "0.1.11" }
|
||||
helpers = { package = "monitor_helpers", version = "0.1.13" }
|
||||
types = { package = "monitor_types", version = "0.1.13" }
|
||||
# types = { package = "monitor_types", path = "../types" }
|
||||
# helpers = { package = "monitor_helpers", path = "../helpers" }
|
||||
tokio-tungstenite = { version = "0.18", features=["native-tls"] }
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "monitor_types"
|
||||
version = "0.1.12"
|
||||
version = "0.1.13"
|
||||
edition = "2021"
|
||||
authors = ["MoghTech"]
|
||||
description = "types for the mogh tech monitor"
|
||||
|
||||
@@ -35,28 +35,36 @@ pub struct Build {
|
||||
#[diff(attr(#[serde(skip_serializing_if = "Option::is_none")]))]
|
||||
pub server_id: String, // server which this image should be built on
|
||||
|
||||
#[builder(default)]
|
||||
pub version: Version,
|
||||
|
||||
// git related
|
||||
#[builder(default)]
|
||||
#[diff(attr(#[serde(skip_serializing_if = "option_diff_no_change")]))]
|
||||
pub repo: Option<String>,
|
||||
|
||||
#[builder(default)]
|
||||
#[diff(attr(#[serde(skip_serializing_if = "option_diff_no_change")]))]
|
||||
pub branch: Option<String>,
|
||||
|
||||
#[builder(default)]
|
||||
#[diff(attr(#[serde(skip_serializing_if = "option_diff_no_change")]))]
|
||||
pub github_account: Option<String>,
|
||||
|
||||
#[builder(default)]
|
||||
#[diff(attr(#[serde(skip_serializing_if = "option_diff_no_change")]))]
|
||||
pub on_clone: Option<Command>,
|
||||
|
||||
// build related
|
||||
#[builder(default)]
|
||||
#[diff(attr(#[serde(skip_serializing_if = "option_diff_no_change")]))]
|
||||
pub pre_build: Option<Command>,
|
||||
|
||||
#[builder(default)]
|
||||
#[diff(attr(#[serde(skip_serializing_if = "option_diff_no_change")]))]
|
||||
pub docker_build_args: Option<DockerBuildArgs>,
|
||||
|
||||
#[builder(default)]
|
||||
#[diff(attr(#[serde(skip_serializing_if = "option_diff_no_change")]))]
|
||||
pub docker_account: Option<String>,
|
||||
|
||||
@@ -128,8 +136,10 @@ impl Version {
|
||||
#[diff(attr(#[derive(Debug, Serialize, PartialEq)]))]
|
||||
pub struct DockerBuildArgs {
|
||||
pub build_path: String,
|
||||
#[builder(default)]
|
||||
pub dockerfile_path: Option<String>,
|
||||
#[serde(default)]
|
||||
#[builder(default)]
|
||||
pub build_args: Vec<EnvironmentVar>,
|
||||
}
|
||||
|
||||
|
||||
@@ -94,39 +94,49 @@ pub struct DeploymentActionState {
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, Diff, Builder)]
|
||||
#[diff(attr(#[derive(Debug, PartialEq, Serialize)]))]
|
||||
pub struct DockerRunArgs {
|
||||
#[builder(default)]
|
||||
#[diff(attr(#[serde(skip_serializing_if = "Option::is_none")]))]
|
||||
pub image: String,
|
||||
|
||||
#[serde(default)]
|
||||
#[builder(default)]
|
||||
#[diff(attr(#[serde(skip_serializing_if = "vec_diff_no_change")]))]
|
||||
pub ports: Vec<Conversion>,
|
||||
|
||||
#[serde(default)]
|
||||
#[builder(default)]
|
||||
#[diff(attr(#[serde(skip_serializing_if = "vec_diff_no_change")]))]
|
||||
pub volumes: Vec<Conversion>,
|
||||
|
||||
#[serde(default)]
|
||||
#[builder(default)]
|
||||
#[diff(attr(#[serde(skip_serializing_if = "vec_diff_no_change")]))]
|
||||
pub environment: Vec<EnvironmentVar>,
|
||||
|
||||
#[serde(default = "default_network")]
|
||||
#[builder(default = "default_network()")]
|
||||
#[diff(attr(#[serde(skip_serializing_if = "Option::is_none")]))]
|
||||
pub network: String,
|
||||
|
||||
#[serde(default)]
|
||||
#[builder(default)]
|
||||
#[diff(attr(#[serde(skip_serializing_if = "restart_mode_diff_no_change")]))]
|
||||
pub restart: RestartMode,
|
||||
|
||||
#[builder(default)]
|
||||
#[diff(attr(#[serde(skip_serializing_if = "option_diff_no_change")]))]
|
||||
pub post_image: Option<String>,
|
||||
|
||||
#[builder(default)]
|
||||
#[diff(attr(#[serde(skip_serializing_if = "option_diff_no_change")]))]
|
||||
pub container_user: Option<String>,
|
||||
|
||||
#[serde(default)]
|
||||
#[builder(default)]
|
||||
#[diff(attr(#[serde(skip_serializing_if = "vec_diff_no_change")]))]
|
||||
pub extra_args: Vec<String>,
|
||||
|
||||
#[builder(default)]
|
||||
#[diff(attr(#[serde(skip_serializing_if = "option_diff_no_change")]))]
|
||||
pub docker_account: Option<String>, // the username of the dockerhub account
|
||||
}
|
||||
|
||||
@@ -28,18 +28,23 @@ pub struct Group {
|
||||
#[builder(setter(skip))]
|
||||
pub permissions: PermissionsMap,
|
||||
|
||||
#[builder(default)]
|
||||
#[diff(attr(#[serde(skip_serializing_if = "vec_diff_no_change")]))]
|
||||
pub builds: Vec<String>,
|
||||
|
||||
#[builder(default)]
|
||||
#[diff(attr(#[serde(skip_serializing_if = "vec_diff_no_change")]))]
|
||||
pub deployments: Vec<String>,
|
||||
|
||||
#[builder(default)]
|
||||
#[diff(attr(#[serde(skip_serializing_if = "vec_diff_no_change")]))]
|
||||
pub servers: Vec<String>,
|
||||
|
||||
#[builder(default)]
|
||||
#[diff(attr(#[serde(skip_serializing_if = "vec_diff_no_change")]))]
|
||||
pub procedures: Vec<String>,
|
||||
|
||||
#[builder(default)]
|
||||
#[diff(attr(#[serde(skip_serializing_if = "vec_diff_no_change")]))]
|
||||
pub groups: Vec<String>,
|
||||
|
||||
|
||||
@@ -24,10 +24,12 @@ pub struct Procedure {
|
||||
pub name: String,
|
||||
|
||||
#[serde(default)]
|
||||
#[builder(default)]
|
||||
#[diff(attr(#[serde(skip_serializing_if = "vec_diff_no_change")]))]
|
||||
pub stages: Vec<ProcedureStage>,
|
||||
|
||||
#[serde(default)]
|
||||
#[builder(default)]
|
||||
#[diff(attr(#[serde(skip_serializing_if = "vec_diff_no_change")]))]
|
||||
pub webhook_branches: Vec<String>,
|
||||
|
||||
|
||||
@@ -34,36 +34,45 @@ pub struct Server {
|
||||
#[builder(setter(skip))]
|
||||
pub permissions: PermissionsMap,
|
||||
|
||||
#[builder(default = "true")]
|
||||
#[diff(attr(#[serde(skip_serializing_if = "Option::is_none")]))]
|
||||
pub enabled: bool,
|
||||
|
||||
#[serde(default)]
|
||||
#[builder(default)]
|
||||
#[diff(attr(#[serde(skip_serializing_if = "vec_diff_no_change")]))]
|
||||
pub to_notify: Vec<String>, // slack users to notify
|
||||
|
||||
#[serde(default)]
|
||||
#[builder(default = "true")]
|
||||
#[diff(attr(#[serde(skip_serializing_if = "Option::is_none")]))]
|
||||
pub auto_prune: bool,
|
||||
|
||||
#[serde(default = "default_cpu_alert")]
|
||||
#[builder(default = "default_cpu_alert()")]
|
||||
#[diff(attr(#[serde(skip_serializing_if = "f32_diff_no_change")]))]
|
||||
pub cpu_alert: f32,
|
||||
|
||||
#[serde(default = "default_mem_alert")]
|
||||
#[builder(default = "default_mem_alert()")]
|
||||
#[diff(attr(#[serde(skip_serializing_if = "f64_diff_no_change")]))]
|
||||
pub mem_alert: f64,
|
||||
|
||||
#[serde(default = "default_disk_alert")]
|
||||
#[builder(default = "default_disk_alert()")]
|
||||
#[diff(attr(#[serde(skip_serializing_if = "f64_diff_no_change")]))]
|
||||
pub disk_alert: f64,
|
||||
|
||||
#[serde(default)]
|
||||
#[builder(default)]
|
||||
#[diff(attr(#[serde(skip_serializing_if = "timelength_diff_no_change")]))]
|
||||
pub stats_interval: Timelength,
|
||||
|
||||
#[builder(default)]
|
||||
#[diff(attr(#[serde(skip_serializing_if = "option_diff_no_change")]))]
|
||||
pub region: Option<String>,
|
||||
|
||||
#[builder(default)]
|
||||
#[diff(attr(#[serde(skip_serializing_if = "option_diff_no_change")]))]
|
||||
pub instance_id: Option<String>,
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "monitor_periphery"
|
||||
version = "0.1.12"
|
||||
version = "0.1.13"
|
||||
edition = "2021"
|
||||
authors = ["MoghTech"]
|
||||
description = "monitor periphery binary | run monitor periphery as system daemon"
|
||||
@@ -15,8 +15,8 @@ path = "src/main.rs"
|
||||
[dependencies]
|
||||
# helpers = { package = "monitor_helpers", path = "../lib/helpers" }
|
||||
# types = { package = "monitor_types", path = "../lib/types" }
|
||||
helpers = { package = "monitor_helpers", version = "0.1.11" }
|
||||
types = { package = "monitor_types", version = "0.1.11" }
|
||||
helpers = { package = "monitor_helpers", version = "0.1.13" }
|
||||
types = { package = "monitor_types", version = "0.1.13" }
|
||||
run_command = { version = "0.0.5", features = ["async_tokio"] }
|
||||
async_timing_util = "0.1.14"
|
||||
tokio = { version = "1.24", features = ["full"] }
|
||||
|
||||
Reference in New Issue
Block a user