pub struct Config {
pub si: Option<SiConfig>,
pub gitlab: Option<GitLabConfig>,
pub jira: Option<JiraConfig>,
pub monitor: Option<MonitorConfig>,
pub server: Option<ServerConfig>,
pub productivity: Option<ProductivityConfig>,
pub report: Option<ReportConfig>,
pub task_discovery: Option<TaskDiscoveryConfig>,
pub jira_inbox: Option<JiraInboxConfig>,
}Expand description
The root configuration. Every module is optional, and unset modules are omitted from the JSON, so the file only names what is configured.
Fields§
§si: Option<SiConfig>SiServer integration.
gitlab: Option<GitLabConfig>GitLab integration (commit discovery).
jira: Option<JiraConfig>Jira integration (issue discovery, inbox).
monitor: Option<MonitorConfig>Activity monitor settings.
server: Option<ServerConfig>External reporting server.
productivity: Option<ProductivityConfig>Productivity thresholds.
report: Option<ReportConfig>Report export defaults.
task_discovery: Option<TaskDiscoveryConfig>Task discovery ignore list; built-in defaults apply when absent.
jira_inbox: Option<JiraInboxConfig>Jira inbox polling; requires jira, disabled when absent.
Implementations§
Source§impl Config
impl Config
Sourcepub fn read() -> Result<Config>
pub fn read() -> Result<Config>
Loads the config file, or defaults when none exists yet.
use kasl::libs::config::Config;
let config = Config::read()?;
if config.jira.is_some() {
println!("Jira integration is configured");
}Sourcepub fn save(&self) -> Result<()>
pub fn save(&self) -> Result<()>
Writes the config as pretty-printed JSON, overwriting the file.
use kasl::libs::config::{Config, MonitorConfig};
let mut config = Config::read()?;
config.monitor = Some(MonitorConfig::default());
config.save()?;Sourcepub fn effective_ignore_names(&self) -> Vec<String>
pub fn effective_ignore_names(&self) -> Vec<String>
Returns the ignore list for task discovery.
When task_discovery is not configured, returns the built-in defaults.
Sourcepub fn add_ignore_names(&mut self, names: &[String]) -> Result<usize>
pub fn add_ignore_names(&mut self, names: &[String]) -> Result<usize>
Appends unique names to the discovery ignore list and saves the config.
Uniqueness is determined by normalize_task_name. Returns how many
new entries were added.
Sourcepub fn set_app_global() -> Result<()>
pub fn set_app_global() -> Result<()>
Adds the executable’s directory to the global PATH.
Windows-shaped: checks the process PATH first, then edits the
machine-level registry value via reg (which needs admin rights;
the setup command downgrades a failure here to a warning).
use kasl::libs::config::Config;
Config::set_app_global()?;