2019-10-05 09:31:23 +00:00
|
|
|
use crate::config::{ModuleConfig, RootModuleConfig, SegmentConfig};
|
|
|
|
|
|
|
|
use ansi_term::{Color, Style};
|
|
|
|
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> {
|
|
|
|
pub symbol: SegmentConfig<'a>,
|
|
|
|
pub context: SegmentConfig<'a>,
|
|
|
|
pub namespace: SegmentConfig<'a>,
|
|
|
|
pub style: Style,
|
|
|
|
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 {
|
2019-10-06 01:46:14 +00:00
|
|
|
symbol: SegmentConfig::new("☸ "),
|
|
|
|
context: SegmentConfig::default(),
|
|
|
|
namespace: SegmentConfig::default(),
|
2019-10-05 09:31:23 +00:00
|
|
|
style: Color::Cyan.bold(),
|
|
|
|
disabled: true,
|
2020-04-03 18:18:44 +00:00
|
|
|
context_aliases: HashMap::new(),
|
2019-10-05 09:31:23 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|