5#include <unordered_set>
7#include <userver/formats/json/value.hpp>
8#include <userver/formats/parse/common_containers.hpp>
9#include <userver/formats/serialize/common_containers.hpp>
10#include <userver/utils/default_dict.hpp>
11#include <userver/utils/impl/internal_tag.hpp>
12#include <userver/utils/impl/transparent_hash.hpp>
14USERVER_NAMESPACE_BEGIN
16namespace dynamic_config {
21 formats::
json::Value Get(std::string_view name)
const;
23 bool Has(std::string_view name)
const;
24 void Set(std::string name, formats::
json::Value);
25 void Parse(std::string_view json_string,
bool empty_ok);
26 void Parse(formats::
json::Value json,
bool empty_ok);
27 void Remove(
const std::string& name);
30 void MergeOrAssign(DocsMap&& source);
31 void MergeMissing(
const DocsMap& source);
33 std::unordered_set<std::string> GetNames()
const;
34 formats::
json::Value AsJson()
const;
35 bool AreContentsEqual(
const DocsMap& other)
const;
41 void SetConfigsExpectedToBeUsed(utils::impl::TransparentSet<std::string> configs,
utils::impl::InternalTag);
44 const utils::impl::TransparentSet<std::string>& GetConfigsExpectedToBeUsed(utils::impl::InternalTag)
const;
48 utils::impl::TransparentMap<std::string, formats::json::Value> docs_;
49 mutable utils::impl::TransparentSet<std::string> configs_to_be_used_;
52template <
typename ValueType>
53using ValueDict = utils::DefaultDict<ValueType>;
55inline constexpr auto kValueDictDefaultName = utils::kDefaultDictDefaultName;