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
components/component_sample_test.hpp
#include <
userver/utest/using_namespace_userver.hpp
>
#pragma once
#include <
userver/components/component_base.hpp
>
#include <
userver/dynamic_config/source.hpp
>
namespace
myservice::smth {
class
Component final :
public
components::ComponentBase
{
public
:
// name of your component to refer in static config
static
constexpr
std::string_view kName =
"smth"
;
Component(
const
components::ComponentConfig
& config,
const
components::ComponentContext
& context);
int
DoSomething()
const
;
~Component()
final
;
static
yaml_config::Schema
GetStaticConfigSchema();
private
:
dynamic_config::Source
config_;
};
}
// namespace myservice::smth
template
<>
inline
constexpr
bool
components::kHasValidate<myservice::smth::Component>
=
true
;
template
<>
inline
constexpr
auto
components::kConfigFileMode<myservice::smth::Component>
= ConfigFileMode::kNotRequired;
Generated on Wed Apr 30 2025 15:48:39 for userver by
Doxygen
1.13.2