userver
C++ Async Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
server_base.hpp
Go to the documentation of this file.
1
#
pragma
once
2
3
/// @file userver/server/server_base.hpp
4
/// @brief Transport-independent HTTP server contract.
5
6
#
include
<
string
>
7
#
include
<
string_view
>
8
#
include
<
vector
>
9
10
#
include
<
userver
/
engine
/
task
/
task_processor_fwd
.
hpp
>
11
#
include
<
userver
/
server
/
congestion_control
/
limiter
.
hpp
>
12
#
include
<
userver
/
server
/
congestion_control
/
sensor
.
hpp
>
13
#
include
<
userver
/
server
/
http
/
http_status
.
hpp
>
14
15
USERVER_NAMESPACE_BEGIN
16
17
namespace
server {
18
19
struct
ServerConfig;
20
namespace
handlers
{
21
class
HttpHandlerBase
;
22
}
23
24
/// @brief Transport-independent HTTP server capabilities used by handlers and congestion control.
25
class
ServerBase
:
public
congestion_control::
Limitee
,
public
congestion_control::
RequestsSource
{
26
public
:
27
virtual
~ServerBase() =
default
;
28
29
/// @brief Return immutable defaults used when constructing handler configurations.
30
virtual
const
server::ServerConfig&
GetConfig
()
const
= 0;
31
32
/// @brief Return the common middleware pipeline for the selected endpoint.
33
virtual
std::vector<std::string>
GetCommonMiddlewares
(
bool
is_monitor)
const
= 0;
34
35
/// @brief Return the endpoint default for the response hostname header.
36
virtual
bool
GetResponseHostnameDefault
(
bool
is_monitor)
const
= 0;
37
38
/// @brief Register a fully constructed handler.
39
virtual
void
AddHandler
(
const
server::
handlers
::
HttpHandlerBase
&, engine::TaskProcessor&) = 0;
40
41
/// @brief Configure the main endpoint's congestion-control rejection status.
42
virtual
void
SetRpsRatelimitStatusCode
(server::
http
::
HttpStatus
status) = 0;
43
};
44
45
}
// namespace server
46
47
USERVER_NAMESPACE_END
userver
server
server_base.hpp
Generated on
for userver by
Doxygen
1.17.0