Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3514916
D5928.id20182.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
864 B
Referenced Files
None
Subscribers
None
D5928.id20182.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D5928: [services/commtest] Tunnelbroker - Adding the tonic client builder function
Attached
Detach File
Event Timeline
Log In to Comment