2021-03-15 10:40:52 +00:00
|
|
|
use crate::config::ModuleConfig;
|
2019-10-05 09:31:23 +00:00
|
|
|
|
2021-03-31 15:31:55 +00:00
|
|
|
use serde::Serialize;
|
2019-10-05 09:31:23 +00:00
|
|
|
use starship_module_config_derive::ModuleConfig;
|
2020-04-03 18:18:44 +00:00
|
|
|
use std::collections::HashMap;
|
2019-10-05 09:31:23 +00:00
|
|
|
|
2021-03-31 15:31:55 +00:00
|
|
|
#[derive(Clone, ModuleConfig, Serialize)]
|
2019-10-05 09:31:23 +00:00
|
|
|
pub struct KubernetesConfig<'a> {
|
2020-07-07 22:45:32 +00:00
|
|
|
pub symbol: &'a str,
|
|
|
|
pub format: &'a str,
|
|
|
|
pub style: &'a str,
|
2019-10-05 09:31:23 +00:00
|
|
|
pub disabled: bool,
|
2020-04-03 18:18:44 +00:00
|
|
|
pub context_aliases: HashMap<String, &'a str>,
|
2019-10-05 09:31:23 +00:00
|
|
|
}
|
|
|
|
|
2021-03-15 10:40:52 +00:00
|
|
|
impl<'a> Default for KubernetesConfig<'a> {
|
|
|
|
fn default() -> Self {
|
2019-10-05 09:31:23 +00:00
|
|
|
KubernetesConfig {
|
2020-07-07 22:45:32 +00:00
|
|
|
symbol: "☸ ",
|
2020-09-08 16:09:21 +00:00
|
|
|
format: "[$symbol$context( \\($namespace\\))]($style) in ",
|
2020-07-07 22:45:32 +00:00
|
|
|
style: "cyan bold",
|
2019-10-05 09:31:23 +00:00
|
|
|
disabled: true,
|
2020-04-03 18:18:44 +00:00
|
|
|
context_aliases: HashMap::new(),
|
2019-10-05 09:31:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|