userver
C++ Async Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
handler_config.hpp
Go to the documentation of this file.
1
#pragma once
2
5
6
#include <optional>
7
#include <string>
8
#include <variant>
9
#include <vector>
10
11
#include <
userver/server/handlers/auth/handler_auth_config.hpp
>
12
#include <
userver/server/handlers/fallback_handlers.hpp
>
13
#include <
userver/server/http/http_status.hpp
>
14
#include <
userver/server/request/request_config.hpp
>
15
#include <
userver/utils/overloaded.hpp
>
16
17
USERVER_NAMESPACE_BEGIN
18
19
namespace
server {
20
struct
ServerConfig;
21
}
// namespace server
22
23
namespace
server::handlers
{
24
26
enum class
UrlTrailingSlashOption
{
27
kBoth
,
28
kStrictMatch
,
29
30
kDefault =
kBoth
,
31
};
32
33
struct
HandlerConfig
{
35
std::variant<std::string, FallbackHandler>
path
;
36
std::optional<std::string> task_processor;
37
std::string method;
38
request::HttpRequestConfig
request_config{};
39
size_t
request_body_size_log_limit{0};
40
size_t
request_headers_size_log_limit{0};
41
size_t
response_data_size_log_limit{0};
42
std::optional<auth::HandlerAuthConfig> auth;
43
UrlTrailingSlashOption
url_trailing_slash{UrlTrailingSlashOption::kDefault};
44
std::optional<size_t> max_requests_in_flight;
45
std::optional<size_t> max_requests_per_second;
46
bool
decompress_request{
true
};
47
bool
throttling_enabled{
true
};
48
bool
response_body_stream{
false
};
49
std::optional<bool> set_response_server_hostname;
50
bool
set_tracing_headers{
true
};
51
bool
deadline_propagation_enabled{
true
};
52
bool
deadline_propagation_prefer_timestamp{
false
};
53
bool
enable_write_statistics{
true
};
54
http::HttpStatus
deadline_expired_status_code{498};
55
57
bool
always_log_request_span
{
false
};
58
59
const
std::string& GetLowCardinalityRequestPath()
const
;
60
};
61
62
HandlerConfig ParseHandlerConfigsWithDefaults(
63
const
yaml_config::YamlConfig
& value,
64
const
server::ServerConfig& server_config,
65
bool
is_monitor =
false
66
);
67
68
}
// namespace server::handlers
69
70
USERVER_NAMESPACE_END
userver
server
handlers
handler_config.hpp
Generated on
for userver by
Doxygen
1.17.0