An etcd client library for Rust.

Overview

etcd

Build Status

An etcd client library for Rust.

Running the tests

  • Install Docker and Docker Compose.
  • Run make. This will drop you into a Bash shell in a container.
  • Inside the container, run cargo test.

License

MIT

Comments
  • Update to Hyper 0.10 and Serde 0.9.

    Update to Hyper 0.10 and Serde 0.9.

    Work in progress. The HTTPS test is failing, but I'm not sure why yet. Unclear if the client is failing to verify the server's cert, or the server is failing to verify the client's cert. I'm also not happy with having to change the API for supplying a client TLS credentials (native-tls only supports PKCS #12), but maybe this API is actually better.

    type/feature 
    opened by jimmycuadra 10
  • Support for managing users, roles

    Support for managing users, roles

    I am building some tooling to not only added keys and directories but also users, roles and grants. This doesn't seem possible with this crate. If I'm wrong, a pointer to how these types of entries can be written as plain nodes would be helpful. Otherwise, an additional module or set of modules to support working these types of data in a cluster would be fantastic.

    effort/normal status/accepted type/feature 
    opened by cmdln 6
  • Dependencies upgraded to latest available version

    Dependencies upgraded to latest available version

    I upgraded all deps, with new hyper version we are no more forced to carry around a tokio core handler reference. The only stylistic doubt I have is about impl From for Clusterinfo, the conversion from String can fail, From can't fail, so I've used log crate to log the failure without panic-ing...

    opened by nappa85 5
  • Connection leak from watch timeout.

    Connection leak from watch timeout.

    I'm using the watch timeout set to 10s. If we've not received a change notification by then I ping the downstream service anyway and then restart the watch. Unfortunately, this leaks a connection every 10s if there is no activity in etcd.

    I assume this is due to the rust-etcd watch integration with hyper. Let me know if you would like any specific diagnostics.

    type/bug 
    opened by jmlMetaswitch 5
  • Implement leader statistics

    Implement leader statistics

    Implementation of the leader statistics API.

    Curious if you think this is the right approach for this. I'm a bit wary that it encodes the current API for these statistics too statically. Alternatively, it could expose something more like the Json object itself, which can be queried dynamically.

    Also curious if you think the leader_stats method on Client is the right place/name for this.

    Note that I added a couple error types: an IO error, which can happen when reading the response into a string, and a JSON decoding error, which happens if the response doesn't match the expected data structure. Let me know if you like that approach and I'll change the other methods that currently panic in those cases; if not, I can make this consistent with everything else.

    opened by jsanders 5
  • Lock dependencies of serde et al.

    Lock dependencies of serde et al.

    Seems that Cargo will consider a requirement string without a prefixed operator equivalent to prefixing a carot: 1.2.3 == ^1.2.3.

    https://github.com/rust-lang/cargo/issues/1418 https://github.com/steveklabnik/semver/issues/81

    As for the 'semver patches shouldn't break things' argument, https://github.com/serde-rs/serde/issues/379

    opened by jasonrm 4
  • Pull JSON decoding into a method in the http module

    Pull JSON decoding into a method in the http module

    This is an idea I had while going through and using try! everywhere we're reading the response into a string in order to propagate IO errors instead of panicking. It works well, but a potential downside is that it accepts StatusCode::Created as a successful response code for all requests, rather than just for "set" operations as before. Not sure whether or not that's a dealbreaker for this approach.

    (Based on #2.)

    opened by jsanders 4
  • createdIndex and modifiedIndex are not present on the root node

    createdIndex and modifiedIndex are not present on the root node

    When getting the root node /, created_index and modified_index are not present.


    Perhaps a better abstraction for this type is needed when all fields are optional. šŸ˜„

    opened by mehcode 3
  • Build failure under Rust 0.11.0

    Build failure under Rust 0.11.0

       Compiling etcd v0.5.4
    /home/kallisti5/.cargo/registry/src/github.com-1ecc6299db9ec823/etcd-0.5.4/build.rs:27:37: 27:50 error: mismatched types [E0308]
    /home/kallisti5/.cargo/registry/src/github.com-1ecc6299db9ec823/etcd-0.5.4/build.rs:27             serde_codegen::register(&mut registry);
                                                                                                                               ^~~~~~~~~~~~~
    /home/kallisti5/.cargo/registry/src/github.com-1ecc6299db9ec823/etcd-0.5.4/build.rs:27:37: 27:50 help: run `rustc --explain E0308` to see a detailed explanation
    /home/kallisti5/.cargo/registry/src/github.com-1ecc6299db9ec823/etcd-0.5.4/build.rs:27:37: 27:50 note: expected type `&mut syntex::Registry`
    /home/kallisti5/.cargo/registry/src/github.com-1ecc6299db9ec823/etcd-0.5.4/build.rs:27:37: 27:50 note:    found type `&mut inner::syntex::Registry`
    error: aborting due to previous error
    error: Could not compile `etcd`.
    
    To learn more, run the command again with --verbose.
    
    effort/easy status/accepted type/bug 
    opened by kallisti5 3
  • etcd 2.2

    etcd 2.2

    Hi. Do you support etсd 2.2?

    On etcd 2.2 i have error: panicked at 'called Result::unwrap() on an Err value: ParseError(SyntaxError("trailing characters", 1, 5))', ../src/libcore/result.rs:688

    let client = Client::default(); let r = client.get("some_key", true, true);

    etcd version - 2.2.3.

    type/bug 
    opened by bmartynov 3
  • Multithread support

    Multithread support

    v0.7 looks like a good step forward. However, from my point-of-view, the release note misses off one significant change: etcd::Client is no longer Send (or Sync). This means that it is difficult to use in a multithreaded application, even when wrapped in an Mutex.

    It appears that making hyper not suitable for multithreading might be deliberate. However, I don't think that needs to be a true of etcd::Client objects. It might even just be a matter of switching from using std::rc::{Rc,Weak} to std::sync::{Arc,Weak}.

    Was it a conscious decision not to support multithreading? (If so, why? Performance?) Might you consider doing so?

    error[E0277]: the trait bound `std::rc::Weak<std::cell::RefCell<tokio_core::reactor::Inner>>: std::marker::Send` is not satisfied in `std::result::Result<etcd::Client<hyper::client::connect::HttpConnector>, etcd::Error>`
      --> src/bin.rs:12:5
       |
    12 |     test_send_trait(arc_etcd);
       |     ^^^^^^^^^^^^^^^ `std::rc::Weak<std::cell::RefCell<tokio_core::reactor::Inner>>` cannot be sent between threads safely
       |
       = help: within `std::result::Result<etcd::Client<hyper::client::connect::HttpConnector>, etcd::Error>`, the trait `std::marker::Send` is not implemented for `std::rc::Weak<std::cell::RefCell<tokio_core::reactor::Inner>>`
       = note: required because it appears within the type `tokio_core::reactor::Handle`
       = note: required because it appears within the type `hyper::client::Client<hyper::client::connect::HttpConnector>`
       = note: required because it appears within the type `etcd::http::HttpClient<hyper::client::connect::HttpConnector>`
       = note: required because it appears within the type `etcd::Client<hyper::client::connect::HttpConnector>`
       = note: required because it appears within the type `std::result::Result<etcd::Client<hyper::client::connect::HttpConnector>, etcd::Error>`
       = note: required because of the requirements on the impl of `std::marker::Send` for `std::sync::Mutex<std::result::Result<etcd::Client<hyper::client::connect::HttpConnector>, etcd::Error>>`
       = note: required because of the requirements on the impl of `std::marker::Send` for `std::sync::Arc<std::sync::Mutex<std::result::Result<etcd::Client<hyper::client::connect::HttpConnector>, etcd::Error>>>`
       = note: required by `test_send_trait`
    
    error[E0277]: the trait bound `std::rc::Rc<std::cell::RefCell<hyper::client::pool::PoolInner<tokio_proto::util::client_proxy::ClientProxy<tokio_proto::streaming::message::Message<hyper::http::MessageHead<hyper::http::RequestLine>, hyper::http::body::Body>, tokio_proto::streaming::message::Message<hyper::http::MessageHead<hyper::http::RawStatus>, tokio_proto::streaming::body::Body<hyper::http::chunk::Chunk, hyper::error::Error>>, hyper::error::Error>>>>: std::marker::Send` is not satisfied in `std::result::Result<etcd::Client<hyper::client::connect::HttpConnector>, etcd::Error>`
      --> src/bin.rs:12:5
       |
    12 |     test_send_trait(arc_etcd);
       |     ^^^^^^^^^^^^^^^ `std::rc::Rc<std::cell::RefCell<hyper::client::pool::PoolInner<tokio_proto::util::client_proxy::ClientProxy<tokio_proto::streaming::message::Message<hyper::http::MessageHead<hyper::http::RequestLine>, hyper::http::body::Body>, tokio_proto::streaming::message::Message<hyper::http::MessageHead<hyper::http::RawStatus>, tokio_proto::streaming::body::Body<hyper::http::chunk::Chunk, hyper::error::Error>>, hyper::error::Error>>>>` cannot be sent between threads safely
       |
       = help: within `std::result::Result<etcd::Client<hyper::client::connect::HttpConnector>, etcd::Error>`, the trait `std::marker::Send` is not implemented for `std::rc::Rc<std::cell::RefCell<hyper::client::pool::PoolInner<tokio_proto::util::client_proxy::ClientProxy<tokio_proto::streaming::message::Message<hyper::http::MessageHead<hyper::http::RequestLine>, hyper::http::body::Body>, tokio_proto::streaming::message::Message<hyper::http::MessageHead<hyper::http::RawStatus>, tokio_proto::streaming::body::Body<hyper::http::chunk::Chunk, hyper::error::Error>>, hyper::error::Error>>>>`
       = note: required because it appears within the type `hyper::client::pool::Pool<tokio_proto::util::client_proxy::ClientProxy<tokio_proto::streaming::message::Message<hyper::http::MessageHead<hyper::http::RequestLine>, hyper::http::body::Body>, tokio_proto::streaming::message::Message<hyper::http::MessageHead<hyper::http::RawStatus>, tokio_proto::streaming::body::Body<hyper::http::chunk::Chunk, hyper::error::Error>>, hyper::error::Error>>`
       = note: required because it appears within the type `hyper::client::Client<hyper::client::connect::HttpConnector>`
       = note: required because it appears within the type `etcd::http::HttpClient<hyper::client::connect::HttpConnector>`
       = note: required because it appears within the type `etcd::Client<hyper::client::connect::HttpConnector>`
       = note: required because it appears within the type `std::result::Result<etcd::Client<hyper::client::connect::HttpConnector>, etcd::Error>`
       = note: required because of the requirements on the impl of `std::marker::Send` for `std::sync::Mutex<std::result::Result<etcd::Client<hyper::client::connect::HttpConnector>, etcd::Error>>`
       = note: required because of the requirements on the impl of `std::marker::Send` for `std::sync::Arc<std::sync::Mutex<std::result::Result<etcd::Client<hyper::client::connect::HttpConnector>, etcd::Error>>>`
       = note: required by `test_send_trait`
    
    opened by jmlMetaswitch 2
  • 0.9.0 does not with tokio 1.x

    0.9.0 does not with tokio 1.x

    The demo code from https://docs.rs/etcd/latest/etcd/ does not compile with tokio 1.x After I managed to make it compile by using futures::compat, at runtime it will give error tokio::spawn failed (is a tokio runtime running this future?). does the author still plan to make it work with newer version of tokio ?

    opened by fireyyouth 0
  • watch_recursive test is not deterministic

    watch_recursive test is not deterministic

    Some time in the last few commits, the watch_recursive integration test has started hanging (never completing) indicating a race condition. I'm not sure whether it was from a change to the library or an update of a dependency that caused it to start doing this, so I'm not sure of the root cause. Needs to be investigated.

    type/bug 
    opened by jimmycuadra 1
Releases(v0.9.0)
  • v0.9.0(Dec 15, 2018)

    Breaking changes:

    • Rust 1.31 or later is now required.
    • Hyper has been updated to the 0.12 series.
    • tokio-core has been replaced with tokio, which changes APIs that used tokio-core's Core type previously.
    • Some method signatures have changed to use impl Trait instead of boxing.

    New features:

    • etcd's authentication and authorization API is now supported.

    Improvements:

    • Many additional common traits are now implemented for most of the types in the crate.
    • The version of etcd tested against has been updated to 2.3.8.
    Source code(tar.gz)
    Source code(zip)
  • v0.8.0(Aug 5, 2017)

  • v0.7.0(Jul 22, 2017)

    Breaking changes:

    0.7.0 is a major update with many breaking changes. The biggest ones are listed below.

    • The crate now uses asynchronous I/O with the futures and tokio crates.
    • API functions have been moved into separate modules.
    • The error enum has several structural changes.
    • Some API endpoint functions that previously had many positional arguments now take an options struct.
    • The "action" field on KeyValueInfo (previously KeySpaceInfo) is now an enum instead of a string.
    • A few struct fields which were previously optional are now always present.
    • The main client type now has three constructors, one for HTTP, one for HTTPS, and one that allows the user to pass in a previously-constructed hyper::Client for full customization of the HTTP layer. The custom constructor is also necessary for X.509 client certificate authentication.

    New features:

    • All I/O is now asynchronous.
    • "Watch" operations on the key-value API can now specify timeouts.
    • Cluster metadata provided in HTTP response headers are now accessible.

    Improvements:

    • Major updates to documentation.
    Source code(tar.gz)
    Source code(zip)
  • v0.6.0(May 2, 2017)

    Breaking changes:

    • ClientOptions now takes a native_tls::TlsConnector instead of paths to PEM-formatted certificate/key files.

    Maintenance updates:

    • Updated hyper to the 0.10 series.
    • Updates serde to the 1.0 series.
    Source code(tar.gz)
    Source code(zip)
  • v0.5.5(Oct 15, 2016)

  • v0.5.4(Jun 4, 2016)

    Maintenance updates:

    • Includes the latest version of syntex (0.33.0) for compatibility with the latest version of the Rust compiler's libsyntax crate.
    Source code(tar.gz)
    Source code(zip)
  • v0.5.3(Jun 4, 2016)

  • v0.5.2(Apr 14, 2016)

  • v0.5.1(Apr 14, 2016)

  • v0.5.0(Mar 30, 2016)

    Breaking changes:

    • Client::default is now implemented via std::default::Default, which requires importing the trait.
    • Client::new now takes a slice of URLs instead of one URL.
    • Client::self_stats, Client::store_stats, and Client::version now return a vector of resultsā€”one for each etcd member the client was initialized with. Additionally, Client::version has been renamed to Client::versions to make this more clear.
    • The Etcd variant of etcd::error::Error has been renamed Api and its contained type, EtcdError, has been renamed ApiError.
    • Two new variants have been added to etcd::error::Error: InvalidUrl and NoEndpoints. See the API docs for their purposes.
    • KeySpaceResult's error type is now a vector of errors, to account for the client supporting multiple etcd members now.
    • The node field of the KeySpaceInfo struct is now wrapped in an Option.
    • The client, error, and keys modules are no longer public. All their user-facing public types are available from the crate root.
    • The fields of the CountStats, FollowerStats, LatencyStats, and VersionInfo structs are no longer wrapped in Options.

    New features:

    • Client now accepts multiple URLs for etcd members. Except for API calls that specifically target a member, each API call will try each member in sequence, returning the first successful result. If all members are exhausted without a successful response, the client will return a vector of errorsā€”one for each member it tried.
    • A new constructor, Client::with_options, takes the new ClientOptions struct as an argument and provides support for three new features:
      1. Using a custom certificate authority for HTTPS connections.
      2. Authenticating with the etcd server(s) using client certificates for HTTPS connections.
      3. Authenticating with the etcd server(s) using a username and password for the auth API introduced in etcd 2.2.
    • etcd::error::Error and etcd::error::ApiError now implement std::error::Error.

    Improvements:

    • Examples of usage have been added to the crate root documentation.
    • Various improvements to API documentation.
    Source code(tar.gz)
    Source code(zip)
  • v0.4.0(Mar 25, 2016)

    New features:

    • Added methods for the self statistics and store statistics APIs.
    • Added an EtcdResult type for results that may return an etcd error.
    Source code(tar.gz)
    Source code(zip)
  • v0.3.1(Feb 19, 2016)

    Improvements:

    • The crate can now be built against both stable (with code generation) and nightly (with compiler plugins).
    • Updates for the latest code generation dependencies and etcd 2.2.5.
    Source code(tar.gz)
    Source code(zip)
  • v0.3.0(Jan 27, 2016)

    Breaking changes:

    • Types are now divided into public modules. Only the most commonly used types are reexported from the crate root.
    • Types that can be deserialized now use Serde (Deserialize) instead of rustc-serialize (RustcDecodable).
    • etcd::Client::get has an additional boolean argument, strong_consistency.

    Improvements:

    • Clarified some details in the documentation.
    Source code(tar.gz)
    Source code(zip)
  • v0.2.0(Jan 27, 2016)

Owner
Jimmy Cuadra
Computer programmer. Creator of @litaio and @ruma.
Jimmy Cuadra
Affine-client is a client for AFFINE based on Tauri

Affine Client affine-client is a client for AFFINE based on Tauri Supported Platforms Windows Linux MacOS Download https://github.com/m1911star/affine

Horus 216 Dec 25, 2022
CouchDB client-side library for the Rust programming language

Chill Chill is a client-side CouchDB library for the Rust programming language, available on crates.io. It targets Rust Stable. Chill's three chief de

null 35 Jun 26, 2022
Mysql client library implemented in rust.

mysql This crate offers: MySql database driver in pure rust; connection pool. Features: macOS, Windows and Linux support; TLS support via nativetls cr

Anatoly I 548 Dec 31, 2022
Skytable rust client support library for the bb8 connection pool

bb8-skytable Skytable rust client support library for the bb8 connection pool. Heavily based on bb8-redis Basic usage example use bb8_skytable::{

null 3 Sep 18, 2021
CouchDB client library for the Rust programming language

CouchDB This project is reborn! As of its v0.6.0 release, the couchdb crate has new life as a toolkit instead of providing a full-blown client. In a n

null 20 Jul 17, 2021
OBKV Table Client is Rust Library that can be used to access table data from OceanBase storage layer.

OBKV Table Client is Rust Library that can be used to access table data from OceanBase storage layer. Its access method is different from JDBC, it skips the SQL parsing layer, so it has significant performance advantage.

OceanBase 4 Nov 14, 2022
rustodrive is a rust client library for communicating with ODrives using the CAN protocol.

rustodrive is a WIP client library for communicating with ODrives using the CAN protocol. It is more than a simple CAN sender/receiver and has many co

null 5 Oct 31, 2022
An async-ready Phoenix Channels v2 client library in Rust

Phoenix Channels This crate implements a Phoenix Channels (v2) client in Rust. Status NOTE: This client is still a work-in-progress, though it has eno

LiveView Native 22 Jan 7, 2023
LDAP client library

LDAP client library A pure-Rust LDAP client library using the Tokio stack. Compatibility with Tokio versions Tokio 1.0 is the long-term stable version

null 166 Jan 4, 2023
Async Lightweight HTTP client using system native library if possible. (Currently under heavy development)

Async Lightweight HTTP Client (aka ALHC) What if we need async but also lightweight http client without using such a large library like reqwest, isahc

SteveXMH 7 Dec 15, 2022
A simple, workable RCS client library.

rust-rcs-client A simple, workable RCS client library. RCS capabilities are mainly provided by your cellular network. This is a working client side im

EverfrosT 3 Jul 6, 2023
Cassandra DB native client written in Rust language. Find 1.x versions on https://github.com/AlexPikalov/cdrs/tree/v.1.x Looking for an async version? - Check WIP https://github.com/AlexPikalov/cdrs-async

CDRS CDRS is looking for maintainers CDRS is Apache Cassandra driver written in pure Rust. ?? Looking for an async version? async-std https://github.c

Alex Pikalov 338 Jan 1, 2023
A Rust client for the ElasticSearch REST API

rs-es Introduction An ElasticSearch client for Rust via the REST API. Targetting ElasticSearch 2.0 and higher. Other clients For later versions of Ela

Ben Ashford 218 Dec 27, 2022
An Elasticsearch REST API client for Rust

elastic elastic is an efficient, modular API client for Elasticsearch written in Rust. The API is targeting the Elastic Stack 7.x. elastic provides st

null 249 Oct 18, 2022
Telegram bot API client for Rust

Frankenstein Telegram bot API client for Rust. It's a complete wrapper for Telegram bot API and it's up to date with version 5.2 of the API. Frankenst

Ayrat Badykov 136 Jan 1, 2023
Streaming STOMP client for Rust

tokio-stomp An async STOMP client (and maybe eventually, server) for Rust, using the Tokio stack. It aims to be fast and fully-featured with a simple

null 7 Jun 15, 2022
Official Skytable client driver for Rust

Skytable client Introduction This library is the official client for the free and open-source NoSQL database Skytable. First, go ahead and install Sky

Skytable 29 Nov 24, 2022
Official Rust client for Central Dogma

centraldogma-rs Official Rust Client for Central Dogma. Full documentation is available at https://docs.rs/centraldogma Getting started Installing Add

LINE 44 Oct 13, 2022
A minecraft-like multi version client implemented in Rust.

Leafish Multi-version Minecraft-compatible client written in Rust, forked from Stevenarella. Chat Chat takes place on Matrix and Discord. The channels

null 617 Dec 27, 2022