Skip to main content

Module etcd

Module etcd 

Source
Expand description

Etcd-backed configuration and service discovery.

use rust_zero_core::{EtcdClient, EtcdConfig};
use std::time::Duration;
let client = EtcdClient::connect(EtcdConfig::new(["http://127.0.0.1:2379"])).await?;
let _lease = client
    .publish("users", "users-1", "http://127.0.0.1:8080", Duration::from_secs(10))
    .await?;
let subscription = client.subscribe("users").await?;
assert!(!subscription.endpoints().is_empty());

Structs§

EtcdClient
A cloneable etcd client scoped to a namespace.
EtcdConfig
Connection and namespace settings for the etcd configuration and discovery adapter.
EtcdConfigWatcher
EtcdServiceLease
EtcdServiceSubscription

Enums§

EtcdError