mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 12:11:56 +00:00
* switch all fe to camelCase * switch to camelCase on backend --------- Co-authored-by: Aiden McClelland <me@drbonez.dev>
36 lines
1.1 KiB
Rust
36 lines
1.1 KiB
Rust
pub use models::HealthCheckId;
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq)]
|
|
#[serde(rename_all = "camelCase")]
|
|
#[serde(tag = "result")]
|
|
pub enum HealthCheckResult {
|
|
Success,
|
|
Disabled,
|
|
Starting,
|
|
Loading { message: String },
|
|
Failure { error: String },
|
|
}
|
|
impl std::fmt::Display for HealthCheckResult {
|
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
|
match self {
|
|
HealthCheckResult::Success => write!(f, "Succeeded"),
|
|
HealthCheckResult::Disabled => write!(f, "Disabled"),
|
|
HealthCheckResult::Starting => write!(f, "Starting"),
|
|
HealthCheckResult::Loading { message } => write!(f, "Loading ({})", message),
|
|
HealthCheckResult::Failure { error } => write!(f, "Failed ({})", error),
|
|
}
|
|
}
|
|
}
|
|
|
|
#[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Eq, ts_rs::TS)]
|
|
#[serde(rename_all = "camelCase")]
|
|
#[ts(export)]
|
|
pub enum HealthCheckString {
|
|
Passing,
|
|
Disabled,
|
|
Starting,
|
|
Warning,
|
|
Failure,
|
|
}
|