userver: userver/components/run.hpp Source File
Loading...
Searching...
No Matches
run.hpp
Go to the documentation of this file.
1#pragma once
2
3/// @file userver/components/run.hpp
4/// @brief Functions to start a service or tool with the specified
5/// config and components::ComponentList.
6
7#include <string>
8
9#include <userver/logging/format.hpp>
10#include <userver/utils/strong_typedef.hpp>
11
13
14USERVER_NAMESPACE_BEGIN
15
16/// Contains functions and types to start a userver based service/tool.
17namespace components {
18
19/// Data type to distinguish config path and in-memory config values in
20/// components::Run() and components::RunOnce() functions.
23};
24
25/// Starts a server with the provided component list and config loaded from
26/// file. Ropens the logging files on SIGUSR1.
27///
28/// @see utils::DaemonMain
29void Run(const std::string& config_path,
30 const std::optional<std::string>& config_vars_path,
31 const std::optional<std::string>& config_vars_override_path,
32 const ComponentList& component_list);
33
34/// Starts a server with the provided component list and config.
35/// Ropens the logging files on SIGUSR1.
36///
37/// @see utils::DaemonMain
38void Run(const InMemoryConfig& config, const ComponentList& component_list);
39
40/// Runs the component list once with the config loaded from file.
41///
42/// @see utils::DaemonMain
43void RunOnce(const std::string& config_path,
44 const std::optional<std::string>& config_vars_path,
45 const std::optional<std::string>& config_vars_override_path,
46 const ComponentList& component_list);
47
48/// Runs the component list once with the config.
49///
50/// @see utils::DaemonMain
51void RunOnce(const InMemoryConfig& config, const ComponentList& component_list);
52
53void RunForPrintConfigSchema(const ComponentList& component_list);
54
55} // namespace components
56
57USERVER_NAMESPACE_END