2021-03-15 10:40:52 +00:00
|
|
|
use crate::config::ModuleConfig;
|
2021-03-31 15:31:55 +00:00
|
|
|
use serde::Serialize;
|
2019-10-04 12:42:33 +00:00
|
|
|
use starship_module_config_derive::ModuleConfig;
|
2020-07-07 22:45:32 +00:00
|
|
|
use std::collections::HashMap;
|
2019-11-02 11:08:54 +00:00
|
|
|
|
2021-03-31 15:31:55 +00:00
|
|
|
#[derive(Clone, ModuleConfig, Serialize)]
|
2019-10-04 12:42:33 +00:00
|
|
|
pub struct AwsConfig<'a> {
|
2020-07-07 22:45:32 +00:00
|
|
|
pub format: &'a str,
|
|
|
|
pub symbol: &'a str,
|
|
|
|
pub style: &'a str,
|
2019-10-04 12:42:33 +00:00
|
|
|
pub disabled: bool,
|
2019-12-20 17:30:47 +00:00
|
|
|
pub region_aliases: HashMap<String, &'a str>,
|
2022-03-12 11:08:33 +00:00
|
|
|
pub profile_aliases: HashMap<String, &'a str>,
|
2021-05-13 00:43:46 +00:00
|
|
|
pub expiration_symbol: &'a str,
|
2022-03-25 21:30:36 +00:00
|
|
|
pub force_display: bool,
|
2019-10-04 12:42:33 +00:00
|
|
|
}
|
|
|
|
|
2021-03-15 10:40:52 +00:00
|
|
|
impl<'a> Default for AwsConfig<'a> {
|
|
|
|
fn default() -> Self {
|
2019-10-04 12:42:33 +00:00
|
|
|
AwsConfig {
|
2021-05-13 00:43:46 +00:00
|
|
|
format: "on [$symbol($profile )(\\($region\\) )(\\[$duration\\])]($style)",
|
2020-07-07 22:45:32 +00:00
|
|
|
symbol: "☁️ ",
|
|
|
|
style: "bold yellow",
|
2019-10-04 12:42:33 +00:00
|
|
|
disabled: false,
|
2019-12-20 17:30:47 +00:00
|
|
|
region_aliases: HashMap::new(),
|
2022-03-12 11:08:33 +00:00
|
|
|
profile_aliases: HashMap::new(),
|
2021-05-13 00:43:46 +00:00
|
|
|
expiration_symbol: "X",
|
2022-03-25 21:30:36 +00:00
|
|
|
force_display: false,
|
2019-11-02 11:08:54 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|