Crates.io | eschudt_consul |
lib.rs | eschudt_consul |
version | 0.1.0 |
source | src |
created_at | 2019-06-03 05:11:28.963949 |
updated_at | 2019-06-03 05:11:28.963949 |
description | Rust client libray for Consul HTTP API |
homepage | |
repository | https://github.com/eschudt/consul-rust |
max_upload_size | |
id | 138623 |
size | 37,608 |
See the documentation here.
Rust client library for the Consul HTTP API.
extern crate consul;
use consul::Client;
use std::collections::HashMap;
fn main() {
let client = Client::new("http://127.0.0.1:8500");
let services: HashMap<String, Vec<String>> = client.catalog.services().unwrap();
println!("{:?}", services);
}
For more examples, see the tests.
Simply include consul-rust in your Cargo dependencies.
[dependencies]
eschudt_consul = "0.1"