pub struct ConfigService { /* private fields */ }Expand description
Configuration service for managing configurations
Implementations§
Source§impl ConfigService
impl ConfigService
Sourcepub fn new(
rpc_client: Arc<RpcClient>,
namespace: &str,
cache_config: CacheConfig,
) -> Self
pub fn new( rpc_client: Arc<RpcClient>, namespace: &str, cache_config: CacheConfig, ) -> Self
Create a new ConfigService
Sourcepub async fn get_config_with_timeout(
&self,
data_id: &str,
group: &str,
_timeout_ms: u64,
) -> Result<String>
pub async fn get_config_with_timeout( &self, data_id: &str, group: &str, _timeout_ms: u64, ) -> Result<String>
Get configuration with timeout
Sourcepub async fn get_config_and_sign_listener<L>(
&self,
data_id: &str,
group: &str,
listener: L,
) -> Result<String>where
L: ConfigListener + 'static,
pub async fn get_config_and_sign_listener<L>(
&self,
data_id: &str,
group: &str,
listener: L,
) -> Result<String>where
L: ConfigListener + 'static,
Get configuration and sign listener
Sourcepub async fn publish_config(
&self,
data_id: &str,
group: &str,
content: &str,
) -> Result<bool>
pub async fn publish_config( &self, data_id: &str, group: &str, content: &str, ) -> Result<bool>
Publish configuration
Sourcepub async fn publish_config_with_type(
&self,
data_id: &str,
group: &str,
content: &str,
config_type: Option<&str>,
) -> Result<bool>
pub async fn publish_config_with_type( &self, data_id: &str, group: &str, content: &str, config_type: Option<&str>, ) -> Result<bool>
Publish configuration with type
Sourcepub async fn remove_config(&self, data_id: &str, group: &str) -> Result<bool>
pub async fn remove_config(&self, data_id: &str, group: &str) -> Result<bool>
Remove configuration
Sourcepub fn add_listener<L>(&self, data_id: &str, group: &str, listener: L)where
L: ConfigListener + 'static,
pub fn add_listener<L>(&self, data_id: &str, group: &str, listener: L)where
L: ConfigListener + 'static,
Add listener for configuration changes
Sourcepub fn add_callback_listener<F>(&self, data_id: &str, group: &str, callback: F)
pub fn add_callback_listener<F>(&self, data_id: &str, group: &str, callback: F)
Add callback listener
Sourcepub fn remove_listener(&self, data_id: &str, group: &str)
pub fn remove_listener(&self, data_id: &str, group: &str)
Remove listener
Sourcepub async fn search_config(
&self,
data_id_pattern: &str,
group_pattern: &str,
page_no: i32,
page_size: i32,
) -> Result<(i32, Vec<ConfigSearchItem>)>
pub async fn search_config( &self, data_id_pattern: &str, group_pattern: &str, page_no: i32, page_size: i32, ) -> Result<(i32, Vec<ConfigSearchItem>)>
Search configurations with pagination
Sourcepub async fn search_config_blur(
&self,
data_id_pattern: &str,
group_pattern: &str,
) -> Result<Vec<ConfigSearchItem>>
pub async fn search_config_blur( &self, data_id_pattern: &str, group_pattern: &str, ) -> Result<Vec<ConfigSearchItem>>
Search configurations with blur matching
Sourcepub async fn get_server_status(&self) -> Result<String>
pub async fn get_server_status(&self) -> Result<String>
Get server status
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ConfigService
impl !RefUnwindSafe for ConfigService
impl Send for ConfigService
impl Sync for ConfigService
impl Unpin for ConfigService
impl !UnwindSafe for ConfigService
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§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