userver: userver/ugrpc/server/middlewares/headers_propagator/component.hpp Source File
Loading...
Searching...
No Matches
component.hpp
Go to the documentation of this file.
1#pragma once
2
3/// @file userver/ugrpc/server/middlewares/headers_propagator/component.hpp
4/// @brief @copybrief
5/// ugrpc::server::middlewares::headers_propagator::Component
6
7#include <userver/ugrpc/server/middlewares/base.hpp>
8
9USERVER_NAMESPACE_BEGIN
10
11/// Server headers_propagator middleware
12namespace ugrpc::server::middlewares::headers_propagator {
13
14// clang-format off
15
16/// @ingroup userver_components userver_base_classes
17///
18/// @brief Component for gRPC server headers_propagator
19///
20/// ## Static options:
21/// Name | Description | Default value
22/// ---- | ----------- | -------------
23/// headers | array of metadata fields (headers) to propagate | empty
24
25// clang-format on
26
27class Component final : public MiddlewareComponentBase {
28 public:
29 /// @ingroup userver_component_names
30 /// @brief The default name of
31 /// ugrpc::server::middlewares::headers_propagator::Component
32 static constexpr std::string_view kName = "grpc-server-headers-propagator";
33
34 Component(const components::ComponentConfig& config,
35 const components::ComponentContext& context);
36
37 std::shared_ptr<MiddlewareBase> GetMiddleware() override;
38
39 static yaml_config::Schema GetStaticConfigSchema();
40
41 private:
42 const std::vector<std::string> headers_;
43};
44
45} // namespace ugrpc::server::middlewares::headers_propagator
46
47USERVER_NAMESPACE_END