diff --git a/services/backup/src/blob/mod.rs b/services/backup/src/blob/mod.rs index 041ff9a9d..b691359d1 100644 --- a/services/backup/src/blob/mod.rs +++ b/services/backup/src/blob/mod.rs @@ -1,10 +1,22 @@ 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}; mod downloader; mod uploader; pub use downloader::*; pub use uploader::*; + +pub type BlobClient = BlobServiceClient; + +/// 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) +}