9#include <userver/components/loggable_component_base.hpp>
10#include <userver/utils/function_ref.hpp>
12#include <userver/ugrpc/server/middlewares/fwd.hpp>
13#include <userver/ugrpc/server/rpc.hpp>
15USERVER_NAMESPACE_BEGIN
20class MiddlewareCallContext
final {
23 MiddlewareCallContext(
const Middlewares& middlewares,
CallAnyBase& call,
24 utils::function_ref<
void()> user_call,
25 std::string_view service_name,
26 std::string_view method_name,
27 const dynamic_config::Snapshot& config,
28 const ::google::protobuf::Message* request);
52 void ClearMiddlewaresResources();
54 Middlewares::const_iterator middleware_;
55 Middlewares::const_iterator middleware_end_;
56 utils::function_ref<
void()> user_call_;
60 std::string_view service_name_;
61 std::string_view method_name_;
62 std::optional<dynamic_config::Snapshot> config_;
63 const ::google::protobuf::Message* request_;
74 virtual ~MiddlewareBase();
79 virtual void Handle(MiddlewareCallContext& context)
const = 0;