pub struct ConfigPusher { /* private fields */ }Expand description
Configuration pusher for distributing config updates to agents.
This allows the proxy to push configuration changes (rules, lists, etc.) to connected agents and track acknowledgments.
Implementations§
Source§impl ConfigPusher
impl ConfigPusher
Sourcepub fn with_config(config: ConfigPusherConfig) -> Self
pub fn with_config(config: ConfigPusherConfig) -> Self
Create a new config pusher with custom configuration.
Sourcepub fn register_agent(
&self,
agent_id: impl Into<String>,
name: impl Into<String>,
supports_push: bool,
)
pub fn register_agent( &self, agent_id: impl Into<String>, name: impl Into<String>, supports_push: bool, )
Register a connected agent.
Sourcepub fn unregister_agent(&self, agent_id: &str)
pub fn unregister_agent(&self, agent_id: &str)
Unregister a disconnected agent.
Sourcepub fn touch_agent(&self, agent_id: &str)
pub fn touch_agent(&self, agent_id: &str)
Update agent’s last seen time.
Sourcepub fn connected_agents(&self) -> Vec<AgentConnection>
pub fn connected_agents(&self) -> Vec<AgentConnection>
Get all connected agents.
Sourcepub fn pushable_agents(&self) -> Vec<AgentConnection>
pub fn pushable_agents(&self) -> Vec<AgentConnection>
Get agents that support config push.
Sourcepub fn push_to_agent(
&self,
agent_id: &str,
update_type: ConfigUpdateType,
) -> Option<String>
pub fn push_to_agent( &self, agent_id: &str, update_type: ConfigUpdateType, ) -> Option<String>
Push a configuration update to a specific agent.
Sourcepub fn push_to_all(&self, update_type: ConfigUpdateType) -> Vec<String>
pub fn push_to_all(&self, update_type: ConfigUpdateType) -> Vec<String>
Push a configuration update to all pushable agents.
Sourcepub fn acknowledge(&self, push_id: &str, accepted: bool, error: Option<String>)
pub fn acknowledge(&self, push_id: &str, accepted: bool, error: Option<String>)
Acknowledge a config push.
Sourcepub fn get_retryable(&self) -> Vec<(String, ConfigUpdateRequest)>
pub fn get_retryable(&self) -> Vec<(String, ConfigUpdateRequest)>
Get pushes that need to be retried.
Sourcepub fn expire_old(&self)
pub fn expire_old(&self)
Expire old pending pushes.
Sourcepub fn get_results(&self) -> Vec<PushResult>
pub fn get_results(&self) -> Vec<PushResult>
Get push results.
Sourcepub fn pending_count(&self) -> usize
pub fn pending_count(&self) -> usize
Get pending push count.
Trait Implementations§
Source§impl Debug for ConfigPusher
impl Debug for ConfigPusher
Auto Trait Implementations§
impl !Freeze for ConfigPusher
impl !RefUnwindSafe for ConfigPusher
impl Send for ConfigPusher
impl Sync for ConfigPusher
impl Unpin for ConfigPusher
impl UnwindSafe for ConfigPusher
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request