aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs23
1 files changed, 8 insertions, 15 deletions
diff --git a/src/main.rs b/src/main.rs
index d5656aa..ead8c32 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -1,31 +1,24 @@
-mod diplonat;
-mod node_state;
-mod environment_adapter;
-mod igd_adapter;
+mod consul;
//use std::net::SocketAddrV4;
//use std::collections::HashMap;
//use igd::PortMappingProtocol;
use log::*;
-use node_state::*;
-use diplonat::*;
+use consul::*;
#[tokio::main]
async fn main() {
pretty_env_logger::init();
info!("Starting Diplonat");
-
+/*
let diplo = Diplonat::new().await.expect("Setup failed");
diplo.listen().await.expect("A runtime error occured");
-/*
- let url = format!("http://127.0.0.1:8500/v1/catalog/node/{}", config.consul_node_name);
- let resp = reqwest::get(&url)
- .await
- .unwrap();
- //.json::<HashMap<String, String>>()
- //.await.unwrap();
- println!("{:#?}", resp);
+*/
+ let c = Consul::new("http://127.0.0.1:8500");
+ let cn = c.catalog_node("lheureduthe").await.expect("Failed to fetch API");
+ println!("{:#?}", cn);
+/*
let gateway = match search_gateway(Default::default()).await {
Ok(g) => g,
Err(err) => return println!("Faild to find IGD: {}", err),