#include <userver/ugrpc/server/call.hpp>
Public Member Functions | |
virtual void | FinishWithError (const grpc::Status &status)=0 |
Complete the RPC with an error. | |
grpc::ServerContext & | GetContext () |
std::string_view | GetCallName () const |
Name of the RPC in the format full.path.ServiceName/MethodName | |
std::string_view | GetServiceName () const |
Get name of gRPC service. | |
std::string_view | GetMethodName () const |
Get name of called gRPC method. | |
tracing::Span & | GetSpan () |
Get the span of the current RPC. Span's lifetime covers the Handle call of the outermost middleware. | |
CallKind | GetCallKind () const |
Get RPCs kind of method. | |
utils::AnyStorage< StorageContext > & | GetStorageContext () |
Returns call context for storing per-call custom data. | |
virtual bool | IsFinished () const =0 |
Useful for generic error reporting via FinishWithError. | |
void | SetMetricsCallName (std::string_view call_name) |
Set a custom call name for metric labels. | |
Protected Member Functions | |
ugrpc::impl::RpcStatisticsScope & | GetStatistics () |
logging::LoggerRef | AccessTskvLogger () |
void | LogFinish (grpc::Status status) const |
void | ApplyRequestHook (google::protobuf::Message *request) |
void | ApplyResponseHook (google::protobuf::Message *response) |
|
inlineprotected |
|
pure virtual |
Complete the RPC with an error.
Finish
must not be called multiple times for the same RPC.
status | error details |
ugrpc::server::RpcError | on an RPC error |
Implemented in ugrpc::server::UnaryCall< Response >, ugrpc::server::InputStream< Request, Response >, ugrpc::server::OutputStream< Response >, and ugrpc::server::BidirectionalStream< Request, Response >.
|
inline |
|
inline |
|
inline |
ServerContext
used for this RPC Finish
call
|
inline |
Get the span of the current RPC. Span's lifetime covers the Handle
call of the outermost middleware.
|
inlineprotected |
|
inline |
Returns call context for storing per-call custom data.
The context can be used to pass data from server middleware to client handler or from one middleware to another one.
In authentication middleware:
In client handler:
|
pure virtual |
Useful for generic error reporting via FinishWithError.
Implemented in ugrpc::server::UnaryCall< Response >, ugrpc::server::InputStream< Request, Response >, ugrpc::server::OutputStream< Response >, and ugrpc::server::BidirectionalStream< Request, Response >.