etcd-client 0.18.0

An etcd v3 API client
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use etcd_client::{Client, Error};

pub const DEFAULT_TEST_ENDPOINT: &str = "localhost:2379";

pub type Result<T> = std::result::Result<T, Error>;

/// Get client for testing.
pub async fn get_client() -> Result<Client> {
    // Require a leader be present -- with only a single node, this
    // should never fail.
    let options = etcd_client::ConnectOptions::new().with_require_leader(true);
    Client::connect([DEFAULT_TEST_ENDPOINT], Some(options)).await
}