userver: components/component_sample_test.hpp
⚠️ This is the documentation for an old userver version. Click here to switch to the latest version.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
components/component_sample_test.hpp
#pragma once
namespace myservice::smth {
class Component final : public components::LoggableComponentBase {
public:
// name of your component to refer in static config
static constexpr std::string_view kName = "smth";
Component(const components::ComponentConfig& config,
int DoSomething() const;
~Component() final;
static yaml_config::Schema GetStaticConfigSchema();
private:
};
} // namespace myservice::smth
template <>
inline constexpr bool components::kHasValidate<myservice::smth::Component> =
true;
template <>
inline constexpr auto components::kConfigFileMode<myservice::smth::Component> =
ConfigFileMode::kNotRequired;