2020-07-07 22:45:32 +00:00
|
|
|
use crate::config::{ModuleConfig, RootModuleConfig};
|
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
|
|
|
|
|
|
|
#[derive(Clone, ModuleConfig)]
|
|
|
|
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
|
|
|
}
|
|
|
|
|
|
|
|
impl<'a> RootModuleConfig<'a> for KubernetesConfig<'a> {
|
|
|
|
fn new() -> Self {
|
|
|
|
KubernetesConfig {
|
2020-07-07 22:45:32 +00:00
|
|
|
symbol: "☸ ",
|
|
|
|
format: "on [$symbol$context( \\($namespace\\))]($style) ",
|
|
|
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|