dodo
0.0.1
A C++ library to create containerized Linux services
|
Go to the documentation of this file.
112 catch (
const std::exception &e ) {
121 catch (
const std::exception &e ) {
128 std::stringstream ss;
129 for (
const auto &k : keypath ) {
130 if ( ss.str().size() ) ss <<
"::";
137 YAML::Node ref = Clone(
yaml_ );
138 for(
const auto &k : keypath ) {
static const Config::KeyPath config_dodo_common_logger
The dodo.common.logger node.
bool exists(const KeyPath &keypath) const
Return true if the KeyPath exists.
static Config * getConfig()
return the singleton.
std::string secret_
The encryption secret / key.
std::string fileReadString(const std::string &filename)
Read the file as a single string.
static Config * config_
The singleton pointer.
static int decrypt(const std::string &key, const std::string src, Bytes &dest)
Decrypt data with a key.
static const Config::KeyPath config_dodo_common_application_secret_file
The dodo.common.application.secret.file node.
An array of Octets with size elements.
static const Config::KeyPath config_dodo_common_logger_syslog_level
The dodo.common.logger.syslog.level node.
std::string getSecret() const
Get the application secret.
static const Config::KeyPath config_dodo
The dodo root node.
static const Config::KeyPath config_dodo_common_application
The dodo.common.application node.
static const Config::KeyPath config_dodo_common_logger_file_directory
The dodo.common.logger.file.directory node.
YAML::Node yaml_
The root YAML node.
Config(const Config &)=delete
Disallow the copy constructor as this is a singleton.
static const Config::KeyPath config_dodo_common_logger_syslog
The dodo.common.logger.syslog node.
void readConfig()
Read the configuration file.
static const Config::KeyPath config_dodo_common_logger_console_level
The dodo.common.logger.console.level node.
static const Config::KeyPath config_dodo_common
The dodo.common node.
Singleton interface to a (read-only) deployment configuration, combining data from the deployment con...
static const Config::KeyPath config_dodo_common_logger_file_max_file_trail
The dodo.common.logger.file.max-file-trail node.
#define throw_Exception(what)
Throws an Exception, passes FILE and LINE to constructor.
static std::string path_
The path to the configuration file.
void checkConfig()
Check for required elements in the config file.
Common and utility interfaces.
static const Config::KeyPath config_dodo_common_logger_file_level
The dodo.common.logger.file.level node.
static const Config::KeyPath config_dodo_common_logger_syslog_facility
The dodo.common.logger.syslog.facility node.
std::list< std::string > KeyPath
Used by getValue, enable use of list initializers as path specification, eg.
static const Config::KeyPath config_dodo_common_application_secret
The dodo.common.application.secret node.
static const Config::KeyPath config_dodo_common_application_name
The dodo.common.application.name node.
static Config * initialize(const std::string path)
Initialize the singleton.
static const Config::KeyPath config_dodo_common_logger_console
The dodo.common.logger.console node.
static const Config::KeyPath config_dodo_common_application_secret_env
The dodo.common.application.secret.env node.
static const Config::KeyPath config_dodo_common_logger_file
The dodo.common.logger.file node.
static std::string flattenKeyPath(const KeyPath &keypath)
Transform a keypath to a string with ":" as seperator between levels.
static const Config::KeyPath config_dodo_common_logger_file_max_size_mib
The dodo.common.logger.file.max-size-mib node.
void getDecryptedValue(const KeyPath &keypath, Bytes &decrypted)
Get the decrypted value from KeyPath - decrypted using the secret from getSecret().