19 releases

new 0.5.0 Feb 19, 2021
0.3.0 Oct 2, 2020
0.3.0-alpha.1 May 11, 2020
0.2.1 Mar 1, 2020
0.0.0 Dec 26, 2018

#54 in Asynchronous

Download history 12/week @ 2020-10-31 33/week @ 2020-11-07 31/week @ 2020-11-14 96/week @ 2020-11-21 82/week @ 2020-11-28 67/week @ 2020-12-05 82/week @ 2020-12-12 64/week @ 2020-12-19 46/week @ 2020-12-26 70/week @ 2021-01-02 63/week @ 2021-01-09 16/week @ 2021-01-16 32/week @ 2021-01-23 17/week @ 2021-01-30 75/week @ 2021-02-06 130/week @ 2021-02-13

265 downloads per month

MIT license

61KB
1.5K SLoC

etcd for Rust

CI Status Crates.io License

An etcd(API v3) client for Rust, and it provides async/await APIs backed by tokio and tonic.

Documentation on the library can be found at docs.rs/etcd-rs.

Features

  • Asynchronous
  • Etcd APIv3

Examples

./examples

Usage

Add following dependencies in your project cargo.toml:

[dependencies]
etcd-rs = "0.5"

Setup Client

let endpoints = vec!["http://127.0.0.1:2379".to_owned()];

let client = Client::connect(ClientConfig {
    endpoints,
    auth: None,
    tls: None
}).await;

if authenticate enabled

let endpoints = vec!["http://127.0.0.1:2379".to_owned()];

let client = Client::connect(ClientConfig {
    endpoints,
    auth: Some(("user".to_owned(), "password".to_owned())),
    tls: None
}).await;

with tls

let endpoints = vec!["https://127.0.0.1:2379".to_owned()];
let tls = ClientTlsConfig::new();

let client = Client::connect(ClientConfig {
    endpoints,
    auth: Some(("user".to_owned(), "password".to_owned())),
    tls: Some(tls)
}).await;

License

This project is licensed under the MIT license.

Dependencies

~13MB
~299K SLoC