etcd-client 0.1.0

An etcd v3 API client
docs.rs failed to build etcd-client-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: etcd-client-0.12.4

etcd-client

MIT licensed

An etcd v3 API client for Rust. It provides asynchronous client backed by tokio and tonic.

Features

  • etcd API v3
  • asynchronous

Supported APIs

  • KV
  • Watch
  • Lease
  • Cluster
  • Maintenance
  • Auth
  • Election
  • Lock

Usage

use ectd_client::*;

let mut client = Client::connect(["localhost:2379"]).await?;
// put kv
client.put("foo", "bar", None).await?;
// get kv
let resp = client.get("foo", None).await?;
if let Some(kv) = resp.kvs().first() {
    println!("Get kv: {{{}: {}}}", kv.key_str()?, kv.value_str()?);
}

Examples

Examples can be found in examples.

Test

We test this library using etcd 3.4.

Notes that we use a fixed etcd server URI (localhost:2379) to connect to etcd server.

Rust version requirements

etcd-client works on rust 1.39 and above as it requires support for the async_await feature.

License

This project is licensed under the MIT license (LICENSE or http://opensource.org/licenses/MIT).

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in etcd-client by you, shall be licensed as MIT, without any additional terms or conditions.