Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3351339
D6384.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
865 B
Referenced Files
None
Subscribers
None
D6384.diff
View Options
diff --git a/services/backup/src/blob/mod.rs b/services/backup/src/blob/mod.rs
--- a/services/backup/src/blob/mod.rs
+++ b/services/backup/src/blob/mod.rs
@@ -1,6 +1,7 @@
mod proto {
tonic::include_proto!("blob");
}
+use proto::blob_service_client::BlobServiceClient;
pub use proto::put_request::Data as PutRequestData;
pub use proto::{PutRequest, PutResponse};
@@ -8,3 +9,14 @@
mod uploader;
pub use downloader::*;
pub use uploader::*;
+
+pub type BlobClient = BlobServiceClient<tonic::transport::Channel>;
+
+/// Creates a new Blob service client instance. It does not attempt to connect
+/// to the service until first use.
+pub fn init_blob_client() -> BlobClient {
+ let service_url = &crate::CONFIG.blob_service_url;
+ let channel =
+ tonic::transport::Channel::from_static(service_url).connect_lazy();
+ BlobServiceClient::new(channel)
+}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 24, 1:04 AM (17 h, 24 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2573360
Default Alt Text
D6384.diff (865 B)
Attached To
Mode
D6384: [backup-service] Add blob client init function
Attached
Detach File
Event Timeline
Log In to Comment