feat: add GrpcMethod extension into request for client (#1275)
* feat: add GrpcMethod extension into request for client * refactor: change GrpcMethod fields into private and expose methods instead * refactor: hide GrpcMethod::new in doc --------- Co-authored-by: Lucio Franco <luciofranco14@gmail.com>
This commit is contained in:
@@ -148,7 +148,10 @@ pub mod health_client {
|
||||
let path = http::uri::PathAndQuery::from_static(
|
||||
"/grpc.health.v1.Health/Check",
|
||||
);
|
||||
self.inner.unary(request.into_request(), path, codec).await
|
||||
let mut req = request.into_request();
|
||||
req.extensions_mut()
|
||||
.insert(GrpcMethod::new("grpc.health.v1.Health", "Check"));
|
||||
self.inner.unary(req, path, codec).await
|
||||
}
|
||||
/// Performs a watch for the serving status of the requested service.
|
||||
/// The server will immediately send back a message indicating the current
|
||||
@@ -185,7 +188,10 @@ pub mod health_client {
|
||||
let path = http::uri::PathAndQuery::from_static(
|
||||
"/grpc.health.v1.Health/Watch",
|
||||
);
|
||||
self.inner.server_streaming(request.into_request(), path, codec).await
|
||||
let mut req = request.into_request();
|
||||
req.extensions_mut()
|
||||
.insert(GrpcMethod::new("grpc.health.v1.Health", "Watch"));
|
||||
self.inner.server_streaming(req, path, codec).await
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user