pub struct Client {Show 13 fields
pub url: String,
pub client_beat_interval: u64,
pub serviceName: String,
pub ip: Option<String>,
pub port: Option<String>,
pub namespaceId: Option<String>,
pub weight: Option<f64>,
pub enabled: Option<bool>,
pub healthy: Option<bool>,
pub metadata: Option<String>,
pub clusterName: Option<String>,
pub groupName: Option<String>,
pub ephemeral: Option<bool>,
}Fields§
§url: Stringnacos链接
client_beat_interval: u64心跳间隔 默认5s
serviceName: String服务名
ip: Option<String>服务实例IP
port: Option<String>服务实例port
namespaceId: Option<String>命名空间ID
weight: Option<f64>权重
enabled: Option<bool>是否上线
healthy: Option<bool>是否健康
metadata: Option<String>扩展信息
clusterName: Option<String>集群名
groupName: Option<String>分组名
ephemeral: Option<bool>是否临时实例
Implementations§
Source§impl Client
example:
Client::init_client(“http://127.0.0.1:8848”, 5)
impl Client
example: Client::init_client(“http://127.0.0.1:8848”, 5)
pub async fn build(&self)
pub async fn build_listen(&self)
pub fn init_client(self, url: &str, client_beat_interval: u64) -> Self
pub fn set_ip_port(self, ip: &str, port: &str) -> Self
pub fn set_service_name(self, service_name: &str) -> Self
pub fn set_group_name(self, group_name: &str) -> Self
pub fn set_space_name(self, space_name: &str) -> Self
pub fn get_service_list(&self, page_no: u64, page_size: u64) -> GetServiceList
pub fn get_instance_list( &self, service_name: &str, healthy_only: bool, ) -> GetInstanceList
pub fn get_beat_info(&self, ins_id: &str) -> BeatInfo
pub fn get_beat(&self, ins_id: &str) -> Beat
pub fn get_instance(&self) -> GetInstance
pub fn get_unregister(&self) -> UnRegister
pub fn get_register(&self) -> Register
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Client
impl<'de> Deserialize<'de> for Client
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Client
impl RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl UnwindSafe for Client
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