# etcd-rs **Repository Path**: rustup/etcd-rs ## Basic Information - **Project Name**: etcd-rs - **Description**: 异步实现的Rust etcd客户端,优点是有一定的文档、作者较为活跃,意味着你提问题他可能会回答,不过,如果你不放心,还是考虑使用HTTP的方式访问ETCD。 - **Primary Language**: Rust - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-01-17 - **Last Updated**: 2022-01-17 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README etcd for Rust ==== [![CI Status][ci-badge]][ci-url] [![Crates.io][crates-badge]][crates-url] [![License][license-badge]][license-url] [ci-badge]: https://img.shields.io/github/workflow/status/luncj/etcd-rs/CI?style=flat-square [ci-url]: https://github.com/luncj/etcd-rs/actions [crates-badge]: https://img.shields.io/crates/v/etcd-rs.svg?style=flat-square [crates-url]: https://crates.io/crates/etcd-rs [license-badge]: https://img.shields.io/github/license/luncj/etcd-rs.svg?style=flat-square [license-url]: https://github.com/luncj/etcd-rs/blob/master/LICENSE An [etcd](https://github.com/etcd-io/etcd) (API v3) client for Rust, and it provides `async/await` APIs backed by [tokio](https://github.com/tokio-rs/tokio) and [tonic](https://github.com/hyperium/tonic). Documentation on the library can be found at [docs.rs/etcd-rs](https://docs.rs/etcd-rs). Features ---- - Asynchronous - Etcd APIv3 Examples ---- [./examples](./examples) Usage ---- Add following dependencies in your project `cargo.toml`: ```toml [dependencies] etcd-rs = "0.6" ``` #### Setup Client ```rust fn foo() { let endpoints = vec!["http://127.0.0.1:2379".to_owned()]; let client = Client::connect(ClientConfig { endpoints, ..Default::default() }).await; } ``` if authenticate enabled ```rust fn foo() { 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())), ..Default::default() }).await; } ``` with tls ```rust fn foo() { 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), ..Default::default() }).await; } ``` Developemnt ---- ### Run tests requirements: - Makefile - docker - docker-compose ```shell make test ``` License ---- This project is licensed under the [MIT license](LICENSE).