pub struct Consul { /* private fields */ }
Expand description
Client used to talk to a Consul server. All calls to the key/value API are automatically prefixed with an arbitrary string that is constructed at client creation.
Implementations§
Source§impl Consul
impl Consul
Sourcepub async fn catalog_node_list(
&self,
last_index: Option<usize>,
) -> Result<WithIndex<Vec<Node>>>
pub async fn catalog_node_list( &self, last_index: Option<usize>, ) -> Result<WithIndex<Vec<Node>>>
The “list nodes” API call of the Catalog API
https://developer.hashicorp.com/consul/api-docs/catalog#list-nodes
Sourcepub async fn catalog_node(
&self,
host: &str,
last_index: Option<usize>,
) -> Result<WithIndex<Option<CatalogNode>>>
pub async fn catalog_node( &self, host: &str, last_index: Option<usize>, ) -> Result<WithIndex<Option<CatalogNode>>>
The “retrieve map of services for a node” API call of the Catalog API
https://developer.hashicorp.com/consul/api-docs/catalog#retrieve-map-of-services-for-a-node
Sourcepub async fn catalog_service_list(
&self,
last_index: Option<usize>,
) -> Result<WithIndex<ServiceList>>
pub async fn catalog_service_list( &self, last_index: Option<usize>, ) -> Result<WithIndex<ServiceList>>
The “list services” API call of the Catalog api
https://developer.hashicorp.com/consul/api-docs/catalog#list-services
Sourcepub async fn catalog_service_nodes(
&self,
service: &str,
last_index: Option<usize>,
) -> Result<WithIndex<Vec<ServiceNode>>>
pub async fn catalog_service_nodes( &self, service: &str, last_index: Option<usize>, ) -> Result<WithIndex<Vec<ServiceNode>>>
The “list nodes for a service” API call of the Catalog api
https://developer.hashicorp.com/consul/api-docs/catalog#list-nodes-for-service
Sourcepub async fn health_service_instances(
&self,
service: &str,
last_index: Option<usize>,
) -> Result<WithIndex<Vec<HealthServiceNode>>>
pub async fn health_service_instances( &self, service: &str, last_index: Option<usize>, ) -> Result<WithIndex<Vec<HealthServiceNode>>>
The “list service instances for a service” API call of the Health api
https://developer.hashicorp.com/consul/api-docs/health#list-service-instances-for-service
Sourcepub fn watch_all_service_health(
&self,
max_retry_interval: Duration,
) -> Receiver<AllServiceHealth>
pub fn watch_all_service_health( &self, max_retry_interval: Duration, ) -> Receiver<AllServiceHealth>
Launches a background task that watches all services and the nodes that serve them, and make that info available in a tokio watch channel. The worker terminates when the channel is dropped.