Crates.io | consul |
lib.rs | consul |
version | 0.4.2 |
source | src |
created_at | 2015-06-15 18:10:38.42092 |
updated_at | 2021-05-11 16:54:10.488136 |
description | Rust client libray for Consul HTTP API |
homepage | |
repository | https://github.com/pierresouchay/consul-rust |
max_upload_size | |
id | 2386 |
size | 56,257 |
Rust client libray for Consul HTTP API
extern crate consul;
use std::collections::HashMap;
use consul::{Client, Config, QueryMeta};
use consul::catalog::Catalog;
fn main(){
let config = Config::new().unwrap();
let client = Client::new(config);
let services: (HashMap<String, String>, QueryMeta) = client.services(None).unwrap();
println!("{:?}", services);
}
For more examples, see the tests .
Simply include the consul-rust in your Cargo dependencies.
[dependencies]
consul = "0.4"