Skip to content

mrwwheat7/etcd-rs

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.3"

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.

About

etcd for rust

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 100.0%