| Crates.io | ya-etcd-rs |
| lib.rs | ya-etcd-rs |
| version | 1.3.0 |
| created_at | 2024-07-01 03:10:49.752067+00 |
| updated_at | 2025-09-04 09:50:00.872728+00 |
| description | etcd client for rust |
| homepage | https://github.com/fikersd/etcd-rs |
| repository | https://github.com/fikersd/etcd-rs |
| max_upload_size | |
| id | 1288330 |
| size | 153,964 |
An etcd (API v3) client for Rust backed by tokio and tonic.
Add following dependencies in your project cargo.toml:
[dependencies]
ya-etcd-rs = "1.2"
use ya_etcd_rs::{Client, ClientConfig, KeyValueOp, Result};
#[tokio::main]
async fn main() -> Result<()> {
let cli = Client::new(ClientConfig::new([
"http://127.0.0.1:12379".into(),
"http://127.0.0.1:22379".into(),
"http://127.0.0.1:32379".into(),
]))
.await?;
cli.put(("foo", "bar")).await.expect("put kv");
let kvs = cli.get("foo").await.expect("get kv").kvs;
assert_eq!(kvs.len(), 1);
Ok(())
}
requirements:
make setup-etcd-cluster
stop cluster
make teardown-etcd-cluster
for specified case:
TEST_CASE=test_put_error make test-one
This project is licensed under the MIT license.