userver
C++ Async Framework
Loading...
Searching...
No Matches
component.hpp
Go to the documentation of this file.
1
#
pragma
once
2
3
/// @file userver/clients/dns/component.hpp
4
/// @brief @copybrief clients::dns::Component
5
6
#
include
<
userver
/
clients
/
dns
/
resolver
.
hpp
>
7
#
include
<
userver
/
components
/
component_base
.
hpp
>
8
#
include
<
userver
/
utils
/
statistics
/
entry
.
hpp
>
9
10
USERVER_NAMESPACE_BEGIN
11
12
namespace
clients::
dns
{
13
14
/// @ingroup userver_components
15
///
16
/// @brief Caching DNS resolver component.
17
///
18
/// Returned references to clients::dns::Resolver live for a lifetime
19
/// of the component and are safe for concurrent use.
20
///
21
/// ## Static options of clients::dns::Component :
22
/// @include{doc} scripts/docs/en/components_schema/core/static_configs/dns_client.md
23
///
24
/// ## Static configuration example:
25
///
26
/// @snippet components/common_component_list_test.cpp Sample dns client component config
27
class
Component
final
:
public
components
::
ComponentBase
{
28
public
:
29
/// @ingroup userver_component_names
30
/// @brief The default name of clients::dns::Component component
31
static
constexpr
std::string_view
kName
=
"dns-client"
;
32
33
Component(
const
components
::ComponentConfig&,
const
components
::ComponentContext&);
34
35
Resolver
& GetResolver();
36
37
private
:
38
void
Write(utils::statistics::Writer& writer);
39
40
Resolver
resolver_;
41
};
42
43
}
// namespace clients::dns
44
45
template
<>
46
inline
constexpr
bool
components
::kForceNoValidation<clients::dns::Component> =
true
;
47
48
template
<>
49
inline
constexpr
auto
components
::kConfigFileMode<clients::dns::Component> =
ConfigFileMode
::
kNotRequired
;
50
51
USERVER_NAMESPACE_END
userver
clients
dns
component.hpp
Generated on Tue Jan 27 2026 16:42:34 for userver by
Doxygen
1.13.2