userver: dynamic_config::ConfigDefault Struct Reference
Loading...
Searching...
No Matches
dynamic_config::ConfigDefault Struct Referencefinal

#include <userver/dynamic_config/snapshot.hpp>

Detailed Description

A config name-value pair for usage in dynamic_config::Key constructors.

Definition at line 58 of file snapshot.hpp.

Public Member Functions

template<typename T>
 ConfigDefault (std::string_view name, const T &value)
template<typename T, typename Tag>
requires std::is_same_v<Tag, NoSchemaHash>
 ConfigDefault (std::string_view name, const T &value, Tag)
 Creates a typed default explicitly omitting schema hash metadata.
 ConfigDefault (std::string_view name, DefaultAsJsonString default_json)
template<typename Tag>
requires std::is_same_v<Tag, NoSchemaHash>
 ConfigDefault (std::string_view name, DefaultAsJsonString default_json, Tag)
 Creates a JSON default explicitly omitting schema hash metadata.
 ConfigDefault (std::string_view name, DefaultAsJsonString default_json, SchemaHash schema_hash)

Public Attributes

std::string_view name
std::string default_json
std::string schema_hash

Constructor & Destructor Documentation

◆ ConfigDefault() [1/5]

template<typename T>
dynamic_config::ConfigDefault::ConfigDefault ( std::string_view name,
const T & value )
Deprecated
Pass a generated dynamic_config::SchemaHash with a JSON default, or explicitly opt out using dynamic_config::NoSchemaHash.

Definition at line 308 of file snapshot.hpp.

◆ ConfigDefault() [2/5]

template<typename T, typename Tag>
requires std::is_same_v<Tag, NoSchemaHash>
dynamic_config::ConfigDefault::ConfigDefault ( std::string_view name,
const T & value,
Tag  )

Creates a typed default explicitly omitting schema hash metadata.

Definition at line 315 of file snapshot.hpp.

◆ ConfigDefault() [3/5]

dynamic_config::ConfigDefault::ConfigDefault ( std::string_view name,
DefaultAsJsonString default_json )
Deprecated
Pass a generated dynamic_config::SchemaHash, or explicitly opt out using dynamic_config::NoSchemaHash.

◆ ConfigDefault() [4/5]

template<typename Tag>
requires std::is_same_v<Tag, NoSchemaHash>
dynamic_config::ConfigDefault::ConfigDefault ( std::string_view name,
DefaultAsJsonString default_json,
Tag  )

Creates a JSON default explicitly omitting schema hash metadata.

Definition at line 322 of file snapshot.hpp.

◆ ConfigDefault() [5/5]

dynamic_config::ConfigDefault::ConfigDefault ( std::string_view name,
DefaultAsJsonString default_json,
SchemaHash schema_hash )
Warning
The schema hash must be supplied by code generation. userver treats it as an opaque value and does not calculate it.

Member Data Documentation

◆ default_json

std::string dynamic_config::ConfigDefault::default_json

Definition at line 99 of file snapshot.hpp.

◆ name

std::string_view dynamic_config::ConfigDefault::name

Definition at line 98 of file snapshot.hpp.

◆ schema_hash

std::string dynamic_config::ConfigDefault::schema_hash

Definition at line 100 of file snapshot.hpp.


The documentation for this struct was generated from the following file: