userver
C++ Async Framework
Toggle main menu visibility
Documentation
API Groups
Namespaces
Reference
Class List
Class Index
File List
Macros
All
e
i
l
r
t
u
Functions
Macros
e
i
l
r
t
u
Examples
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Modules
Pages
Concepts
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
// clang-format off
15
16
/// @ingroup userver_components
17
///
18
/// @brief Caching DNS resolver component.
19
///
20
/// Returned references to clients::dns::Resolver live for a lifetime
21
/// of the component and are safe for concurrent use.
22
///
23
/// ## Static options:
24
/// Name | Description | Default value
25
/// ---- | ----------- | -------------
26
/// fs-task-processor | task processor for disk I/O operations | -
27
/// hosts-file-path | path to the `hosts` file | /etc/hosts
28
/// hosts-file-update-interval | `hosts` file cache reload interval | 5m
29
/// network-timeout | timeout for network requests | 1s
30
/// network-attempts | number of attempts for network requests | 1
31
/// network-custom-servers | list of name servers to use | from `/etc/resolv.conf`
32
/// cache-ways | number of ways for network cache | 16
33
/// cache-size-per-way | size of each way of network cache | 256
34
/// cache-max-reply-ttl | TTL limit for network replies caching | 5m
35
/// cache-failure-ttl | TTL for network failures caching | 5s
36
///
37
/// ## Static configuration example:
38
///
39
/// @snippet components/common_component_list_test.cpp Sample dns client component config
40
41
// clang-format on
42
class
Component
final
:
public
components
::
ComponentBase
{
43
public
:
44
/// @ingroup userver_component_names
45
/// @brief The default name of clients::dns::Component component
46
static
constexpr
std::string_view
kName
=
"dns-client"
;
47
48
Component(
const
components
::ComponentConfig&,
const
components
::ComponentContext&);
49
50
Resolver
& GetResolver();
51
52
private
:
53
void
Write(
utils
::statistics::Writer& writer);
54
55
Resolver
resolver_;
56
utils
::statistics::Entry statistics_holder_;
57
};
42
class
Component
final
:
public
components
::
ComponentBase
{
…
};
58
59
}
// namespace clients::dns
60
61
template
<>
62
inline
constexpr
bool
components
::kForceNoValidation<clients::dns::Component> =
true
;
63
64
USERVER_NAMESPACE_END
userver
clients
dns
component.hpp
Generated on Wed Apr 30 2025 15:49:04 for userver by
Doxygen
1.13.2