Skip to content

vkrinitsyn/etcd

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

etcd

Minimum rustc version Crate API

License: Apache OR License: MIT

Server implementation of a etcd v3 API client on Rust. It provides asynchronous client backed by tokio and tonic.

Important

This is an experimental Prof of Concept of the features bellow

Features

  • etcd API v3 compatible client using protobuf to leverage existing ecosystem
  • priority is a queue implementation with order and delivery guarantee
  • no message storage, cluster election, as use another cluster implementation
  • ability to build into another rust application as a component, see rppd

Supported APIs

  • KV (wo: filter, range, version, pagination, linearizable read)
  • Watch (wo: filter, fragment, ranges, revision)

Low priority:

  • Lock
  • Namespace
  • Lease

Lowest priority:

  • Auth
  • Maintenance
  • Cluster
  • Election

Usage

Add this to your Cargo.toml:

[dependencies]
etcd-client = "0.14"
tokio = { version = "1.0", features = ["full"] }

To get started using etcd:

use etcd_client::{Client, Error};

#[tokio::main]
async fn main() -> Result<(), Error> {
    let mut client = Client::connect(["localhost:2379"], None).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()?);
    }

    Ok(())
}

Examples

Examples can be found in examples.

License

Dual-licensed to be compatible with the Rust project.

Licensed under the Apache License, Version 2.0 http://www.apache.org/licenses/LICENSE-2.0 or the MIT license http://opensource.org/licenses/MIT, at your option. This file may not be copied, modified, or distributed except according to those terms.

Contribution

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

About

etcd v3 server PoC queue messaging

Resources

License

MIT and 2 other licenses found

Licenses found

MIT
LICENSE
Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages