Page MenuHomePhabricator

D6384.diff
No OneTemporary

D6384.diff

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

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)

Event Timeline