Some checks failed
continuous-integration/drone/push Build is failing
Signed-off-by: kjuulh <contact@kjuulh.io>
24 lines
605 B
Rust
24 lines
605 B
Rust
use std::collections::HashMap;
|
|
|
|
#[derive(Default)]
|
|
pub struct ClusterList {}
|
|
|
|
impl ClusterList {
|
|
pub async fn get_list(&self) -> anyhow::Result<HashMap<String, Vec<String>>> {
|
|
Ok(HashMap::from([
|
|
("dev".into(), vec!["clank-dev".into()]),
|
|
("prod".into(), vec!["clank-prod".into()]),
|
|
]))
|
|
}
|
|
|
|
pub async fn get(&self, environment: &str) -> anyhow::Result<Option<Vec<String>>> {
|
|
let list = self.get_list().await?;
|
|
|
|
if let Some(x) = list.get(environment) {
|
|
Ok(Some(x.clone()))
|
|
} else {
|
|
Ok(None)
|
|
}
|
|
}
|
|
}
|