From fdffe913974a281ca6ff79389875a2fb29e353b7 Mon Sep 17 00:00:00 2001 From: Quentin Date: Fri, 14 Feb 2020 10:46:39 +0100 Subject: consul lib does not work for us, switching to reqwest --- src/main.rs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/main.rs b/src/main.rs index 84acca1..7a33bab 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,8 +4,7 @@ use std::net::SocketAddrV4; use igd::aio::search_gateway; use igd::PortMappingProtocol; -use consul::catalog::Catalog; -use consul::{Client, Config}; +use std::collections::HashMap; struct DiplonatConfig { private_ip: String, @@ -58,13 +57,12 @@ async fn main() { Err(e) => return println!("unable to build configuration: {}", e), }; - let consul_config = Config::new().unwrap(); - let consul_client = Client::new(consul_config); - - match consul_client.nodes(None) { - Ok(v) => println!("ok: {:?}", v), - Err(err) => println!("err: {}", err), - }; + let resp = reqwest::get("http://127.0.0.1:5000") + .await + .unwrap() + .json::>() + .await.unwrap(); + println!("{:#?}", resp); let gateway = match search_gateway(Default::default()).await { Ok(g) => g, -- cgit v1.2.3