feat: Add Grpc::with_origin for clients (#1017)

This commit is contained in:
Lucio Franco
2022-06-20 09:36:51 -04:00
committed by GitHub
parent 4388d822c4
commit 10f6d2f1a9
3 changed files with 32 additions and 23 deletions
+6
View File
@@ -44,6 +44,7 @@ pub fn generate<T: Service>(
clippy::let_unit_value,
)]
use tonic::codegen::*;
use tonic::codegen::http::Uri;
#service_doc
#(#struct_attributes)*
@@ -66,6 +67,11 @@ pub fn generate<T: Service>(
Self { inner }
}
pub fn with_origin(inner: T, origin: Uri) -> Self {
let inner = tonic::client::Grpc::with_origin(inner, origin);
Self { inner }
}
pub fn with_interceptor<F>(inner: T, interceptor: F) -> #service_ident<InterceptedService<T, F>>
where
F: tonic::service::Interceptor,