pub struct ConfigService { /* private fields */ }Expand description
Holds the live config and applies mutations at runtime: each change is validated against provider capabilities and persisted. Secrets go to the secret store; the config only ever references them by key.
Implementations§
Source§impl ConfigService
impl ConfigService
pub fn new( store: Arc<dyn ConfigStore>, secrets: Arc<dyn SecretStore>, registry: Arc<ProviderRegistry>, ) -> Self
pub async fn load(&self) -> Result<()>
pub fn snapshot(&self) -> ForgetopConfig
Sourcepub fn subscribe_data_changed(&self) -> Receiver<u64>
pub fn subscribe_data_changed(&self) -> Receiver<u64>
Fires whenever connections or section bindings change, from anywhere in the
process. A watch channel coalesces bursts, so the multi-step setup flow
(add connection, then bind each section) settles into one reload rather than four.
pub async fn add_or_update_connection( &self, connection: Connection, secret: Option<String>, ) -> Result<()>
pub async fn remove_connection(&self, connection_id: &str) -> Result<()>
pub async fn bind_pull_requests(&self, connection_id: &str) -> Result<()>
pub async fn bind_work_items(&self, connection_id: &str) -> Result<()>
Sourcepub async fn unbind_pull_requests(&self, connection_id: &str) -> Result<()>
pub async fn unbind_pull_requests(&self, connection_id: &str) -> Result<()>
Removes a single connection from the PR section (leaves others bound).
Sourcepub async fn unbind_work_items(&self, connection_id: &str) -> Result<()>
pub async fn unbind_work_items(&self, connection_id: &str) -> Result<()>
Removes a single connection from the work-item section (leaves others bound).
Sourcepub async fn unbind_pipelines(&self, connection_id: &str) -> Result<()>
pub async fn unbind_pipelines(&self, connection_id: &str) -> Result<()>
Drops a connection’s pipeline subscription entirely (unbinds it from the section).
Sourcepub async fn set_pull_request_connections(
&self,
connection_ids: Vec<String>,
) -> Result<()>
pub async fn set_pull_request_connections( &self, connection_ids: Vec<String>, ) -> Result<()>
Replaces the PR section’s connections with an explicit set (multi-bind).
pub async fn set_work_item_connections( &self, connection_ids: Vec<String>, ) -> Result<()>
pub async fn unbind_section(&self, section: Section) -> Result<()>
pub async fn subscribe_pipeline( &self, connection_id: &str, definition_id: &str, ) -> Result<()>
pub async fn set_pipeline_auto_discover( &self, connection_id: &str, auto_discover_all: bool, ) -> Result<()>
pub async fn unsubscribe_pipeline( &self, connection_id: &str, definition_id: &str, ) -> Result<()>
pub async fn remove_pipeline_connection( &self, connection_id: &str, ) -> Result<()>
Sourcepub async fn set_repo_scope(
&self,
connection_id: &str,
scope: Option<Vec<String>>,
) -> Result<()>
pub async fn set_repo_scope( &self, connection_id: &str, scope: Option<Vec<String>>, ) -> Result<()>
Replaces a connection’s repository scope. Some(vec![]) is a real, respected state — the
user chose no repositories — and must not be confused with None, which means the scope
was never established and the legacy single repository still applies.
Sourcepub fn repo_scope(&self, connection_id: &str) -> Option<Vec<String>>
pub fn repo_scope(&self, connection_id: &str) -> Option<Vec<String>>
A connection’s stored scope, exactly as stored (including the None / Some([])
distinction) — the picker needs to tell “never chosen” from “chose none”.
pub async fn set_theme(&self, theme: Option<String>) -> Result<()>
pub async fn set_dismissed_launchpad_items( &self, dismissed: Vec<String>, ) -> Result<()>
pub async fn set_notifications(&self, prefs: NotificationPrefs) -> Result<()>
Sourcepub async fn set_views(
&self,
section: Section,
views: Vec<SavedView>,
) -> Result<()>
pub async fn set_views( &self, section: Section, views: Vec<SavedView>, ) -> Result<()>
Persists the saved views for a section.
Sourcepub async fn set_sort(
&self,
section: Section,
sort: Option<SortPref>,
) -> Result<()>
pub async fn set_sort( &self, section: Section, sort: Option<SortPref>, ) -> Result<()>
Persists the sort for a section (None restores provider order).