Rust client libray for Consul HTTP API
extern crate consul;
use std::collections::HashMap;
use consul::Client;
fn main(){
let client = Client::new("127.0.0.1:8500");
let services: HashMap<String, Vec<String>> = client.catalog.services();
println!("{:?}", services);
}
For more example, see the tests .
Simply include the consul-rust in your Cargo dependencies.
[dependencies]
consul = "0.0.5"