juicycleff / consul-rust

Rust client libray for Consul HTTP API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

async-consul-rust

Build Status

Documentation here.

Rust client libray for Consul HTTP API

Usage

    extern crate consul;

    use std::collections::HashMap;
    use consul::{Client, Config, QueryMeta};
    use consul::catalog::Catalog;

    async fn main(){
        let config = Config::new().unwrap();
        let client = Client::new(config);
		let services: (HashMap<String, String>, QueryMeta) = client.services(None).await.unwrap();
		println!("{:?}", services);
    }

For more examples, see the tests .

Installation

Simply include the consul-rust in your Cargo dependencies.

[dependencies]
consul = "0.4"

About

Rust client libray for Consul HTTP API

License:Apache License 2.0


Languages

Language:Rust 99.5%Language:Shell 0.5%