Make CDH great (...not again) (#3)

This commit is contained in:
allanger
2023-01-16 21:05:07 +01:00
committed by GitHub
parent fc346d45f1
commit 6793f17e3a
14 changed files with 460 additions and 194 deletions

View File

@ -1,5 +1,6 @@
use serde::{Deserialize, Serialize};
use std::fmt;
use tabled::Tabled;
/// Struct for parsing charts info from helmfile
#[derive(Serialize, Deserialize, Debug, PartialEq, Eq)]
@ -15,8 +16,8 @@ pub(crate) struct HelmRepo {
pub(crate) url: String,
}
#[derive(Clone, Serialize)]
enum Status {
#[derive(Clone, Serialize, Deserialize)]
pub(crate) enum Status {
Uptodate,
Outdated,
Missing,
@ -31,3 +32,22 @@ impl fmt::Display for Status {
}
}
}
#[derive(Clone, Tabled, Serialize, Deserialize)]
pub(crate) struct ExecResult {
pub(crate) name: String,
pub(crate) latest_version: String,
pub(crate) current_version: String,
pub(crate) status: Status,
}
impl ExecResult {
pub(crate) fn new(name: String, latest_version: String, current_version: String, status: Status) -> Self {
Self {
name,
latest_version,
current_version,
status,
}
}
}