#include <userver/ugrpc/server/middlewares/base.hpp>
Context for middleware-specific data during gRPC call.
Public Member Functions | |
| void | SetError (grpc::Status &&status) noexcept |
| Aborts the RPC, returning the specified status to the upstream client, see details below. | |
| RpcType | GetRpcType () const noexcept |
| const dynamic_config::Snapshot & | GetInitialDynamicConfig () const |
| Get values extracted from dynamic_config. Snapshot will be deleted when the last middleware completes. | |
| grpc::ServerContextBase & | GetServerContext () |
| const grpc::ServerContextBase & | GetServerContext () const |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| 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. | |
| utils::AnyStorage< StorageContext > & | GetStorageContext () |
| Returns call context for storing per-call custom data. | |
|
noexcept |
|
inherited |
|
inherited |
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:
|
noexcept |
Aborts the RPC, returning the specified status to the upstream client, see details below.
It should be the last command in middlewares hooks.
If that method is called in methods:
Example usage