Page MenuHomePhabricator

D5928.id20182.diff
No OneTemporary

D5928.id20182.diff

diff --git a/services/commtest/src/tunnelbroker/tunnelbroker_utils.rs b/services/commtest/src/tunnelbroker/tunnelbroker_utils.rs
--- a/services/commtest/src/tunnelbroker/tunnelbroker_utils.rs
+++ b/services/commtest/src/tunnelbroker/tunnelbroker_utils.rs
@@ -1,4 +1,16 @@
+use std::env;
+use tonic::transport::Channel;
+use tonic::transport::Error;
pub mod proto {
tonic::include_proto!("tunnelbroker");
}
pub use proto::tunnelbroker_service_client::TunnelbrokerServiceClient;
+
+pub async fn tonic_client_builder(
+) -> Result<TunnelbrokerServiceClient<Channel>, Error> {
+ let port = env::var("COMM_SERVICES_PORT_TUNNELBROKER")
+ .unwrap_or(String::from("50051"));
+ let host = env::var("COMM_SERVICES_HOST_TUNNELBROKER")
+ .unwrap_or(String::from("localhost"));
+ TunnelbrokerServiceClient::connect(format!("http://{}:{}", host, port)).await
+}

File Metadata

Mime Type
text/plain
Expires
Mon, Dec 23, 6:58 AM (18 h, 8 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2693166
Default Alt Text
D5928.id20182.diff (864 B)

Event Timeline