diff --git a/src/lib.rs b/src/lib.rs index f988b12..1880c26 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -36,11 +36,11 @@ pub mod config { #[derive(Clone, Serialize, Deserialize, prost::Message)] pub struct RestartPolicy { #[prost(uint32, tag = "1")] - max_retries: u32, + pub max_retries: u32, #[prost(uint32, tag = "2")] - delay_seconds: u32, + pub delay_seconds: u32, #[prost(oneof = "RestartPolicyType", tags = "3, 4")] - policy: Option, + pub policy: Option, } #[derive(Clone, Serialize, Deserialize, prost::Oneof)] @@ -51,6 +51,12 @@ pub mod config { OnNonZeroExit(bool), } + impl Default for RestartPolicyType { + fn default() -> Self { + RestartPolicyType::Always(true) + } + } + #[derive(Clone, Serialize, Deserialize, prost::Message)] pub struct ChildProcess { #[prost(string, tag = "1")] @@ -58,7 +64,7 @@ pub mod config { #[prost(string, repeated, tag = "2")] pub arguments: Vec, #[prost(message, optional, tag = "3")] - restart: Option, + pub restart: Option, } #[derive(Clone, Serialize, Deserialize, prost::Message)]