userver: ugrpc::client::MiddlewareCallContext Class Reference
Loading...
Searching...
No Matches
ugrpc::client::MiddlewareCallContext Class Referencefinal

#include <userver/ugrpc/client/middlewares/base.hpp>

Detailed Description

Context for middleware-specific data during gRPC call.

It is created for each gRPC Call and it stores aux. data used by middlewares. Each registered middleware is called by Middleware::Handle with the context passed as an argument. A middleware may access Call and initial request (if any) using the context.

Examples
samples/grpc_middleware_service/src/middlewares/client/middleware.cpp, and samples/grpc_middleware_service/src/middlewares/client/middleware.hpp.

Definition at line 24 of file base.hpp.

Public Member Functions

grpc::ClientContext & GetContext () noexcept
 
std::string_view GetClientName () const noexcept
 
std::string_view GetCallName () const noexcept
 
CallKind GetCallKind () const noexcept
 
tracing::SpanGetSpan () noexcept
 

Member Function Documentation

◆ GetCallKind()

CallKind ugrpc::client::MiddlewareCallContext::GetCallKind ( ) const
noexcept
Returns
RPC kind

◆ GetCallName()

std::string_view ugrpc::client::MiddlewareCallContext::GetCallName ( ) const
noexcept
Returns
RPC name

◆ GetClientName()

std::string_view ugrpc::client::MiddlewareCallContext::GetClientName ( ) const
noexcept
Returns
client name

◆ GetContext()

grpc::ClientContext & ugrpc::client::MiddlewareCallContext::GetContext ( )
noexcept
Returns
the ClientContext used for this RPC
Examples
samples/grpc_middleware_service/src/middlewares/client/middleware.cpp.

◆ GetSpan()

tracing::Span & ugrpc::client::MiddlewareCallContext::GetSpan ( )
noexcept
Returns
RPC span

The documentation for this class was generated from the following file: