userver
C++ Async Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
component.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#ifdef USERVER_TVM2_HTTP_CLIENT
4
#error Use components::Http from clients/http.hpp instead
5
#endif
6
9
10
#include <memory>
11
12
#include <
userver/clients/http/client.hpp
>
13
#include <
userver/clients/http/client_with_middlewares.hpp
>
14
#include <
userver/clients/http/component_core.hpp
>
15
16
USERVER_NAMESPACE_BEGIN
17
18
namespace
components
{
19
47
class
HttpClient :
public
ComponentBase {
48
public
:
51
static
constexpr
std::string_view
kName
=
"http-client"
;
52
55
static
constexpr
std::string_view
kDynamicConfigClientName
=
"dynamic-config-http-client"
;
56
57
HttpClient(
const
ComponentConfig
&,
const
ComponentContext
&);
58
59
clients::http::Client
& GetHttpClient();
60
61
static
yaml_config::Schema
GetStaticConfigSchema
();
62
63
protected
:
65
HttpClient
(
const
ComponentConfig
&,
const
ComponentContext
&, std::unique_ptr<clients::http::Client>);
66
67
private
:
68
std::unique_ptr<clients::http::Client> http_client_;
69
};
70
71
template
<>
72
inline
constexpr
bool
kHasValidate<HttpClient>
=
true
;
73
74
template
<>
75
inline
constexpr
auto
kConfigFileMode<HttpClient>
=
ConfigFileMode::kNotRequired
;
76
77
}
// namespace components
78
79
USERVER_NAMESPACE_END
userver
clients
http
component.hpp
Generated on
for userver by
Doxygen
1.17.0