diff options
author | Alex Auvolat <alex@adnab.me> | 2021-12-30 20:42:56 +0100 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2021-12-30 20:42:56 +0100 |
commit | 04bdd029fefbce08184c12809b5d6e4bf2a12fa1 (patch) | |
tree | 9f03cccf6558df489ff05c65c23d6a01a7a2f02d /src/consul_actor.rs | |
parent | 4560622fa125afb8ac5161f8d0e8a353f99f7a38 (diff) | |
download | diplonat-04bdd029fefbce08184c12809b5d6e4bf2a12fa1.tar.gz diplonat-04bdd029fefbce08184c12809b5d6e4bf2a12fa1.zip |
Add TLS support for Consul
Diffstat (limited to 'src/consul_actor.rs')
-rw-r--r-- | src/consul_actor.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/consul_actor.rs b/src/consul_actor.rs index 61789ca..8b722b6 100644 --- a/src/consul_actor.rs +++ b/src/consul_actor.rs @@ -6,6 +6,7 @@ use serde::{Deserialize, Serialize}; use serde_lexpr::{error, from_str}; use tokio::{sync::watch, time::sleep}; +use crate::config::RuntimeConfigConsul; use crate::{consul, messages}; #[derive(Serialize, Deserialize, Debug)] @@ -74,14 +75,14 @@ fn to_open_ports(params: &Vec<DiplonatConsul>) -> messages::PublicExposedPorts { } impl ConsulActor { - pub fn new(url: &str, node: &str) -> Self { + pub fn new(config: &RuntimeConfigConsul, node: &str) -> Self { let (tx, rx) = watch::channel(messages::PublicExposedPorts { tcp_ports: HashSet::new(), udp_ports: HashSet::new(), }); return Self { - consul: consul::Consul::new(url), + consul: consul::Consul::new(config), rx_open_ports: rx, tx_open_ports: tx, node: node.to_string(), |