diff options
author | Alex Auvolat <alex@adnab.me> | 2021-12-25 19:19:19 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2021-12-25 19:23:18 +0100 |
commit | 3b9e75634aa06b6df0519e5d44fd6e5281712d09 (patch) | |
tree | d82e14884993895a13cdca78c7388de2e0846f0f /src/consul.rs | |
parent | 4d4d453afa3edafe71db2ae60171b8696b38a3c9 (diff) | |
download | diplonat-3b9e75634aa06b6df0519e5d44fd6e5281712d09.tar.gz diplonat-3b9e75634aa06b6df0519e5d44fd6e5281712d09.zip |
Allow Diplonat to automatically detect it's private IP
Diffstat (limited to 'src/consul.rs')
-rw-r--r-- | src/consul.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/consul.rs b/src/consul.rs index 4e6fe5d..4e4f79c 100644 --- a/src/consul.rs +++ b/src/consul.rs @@ -25,10 +25,12 @@ impl Consul { client: reqwest::Client::new(), url: url.to_string(), idx: None, - } + }; } - pub fn watch_node_reset(&mut self) -> () { self.idx = None; } + pub fn watch_node_reset(&mut self) -> () { + self.idx = None; + } pub async fn watch_node(&mut self, host: &str) -> Result<CatalogNode> { let url = match self.idx { @@ -43,6 +45,6 @@ impl Consul { }; let resp: CatalogNode = http.json().await?; - return Ok(resp) + return Ok(resp); } } |