Page MenuHomePhabricator

D5928.id19553.diff
No OneTemporary

D5928.id19553.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,17 @@
+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_TUNNELBROKER_PORT").expect(
+ "`COMM_SERVICES_TUNNELBROKER_PORT` environment variable expected but not received",
+ );
+ let host = env::var("COMM_SERVICES_TUNNELBROKER_HOST")
+ .unwrap_or(String::from("localhost"));
+ TunnelbrokerServiceClient::connect(format!("http://{}:{}", host, port)).await
+}

File Metadata

Mime Type
text/plain
Expires
Mon, Dec 23, 7:42 AM (18 h, 58 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2694024
Default Alt Text
D5928.id19553.diff (927 B)

Event Timeline