userver: userver/storages/redis/redis_config.hpp Source File
Loading...
Searching...
No Matches
redis_config.hpp
1#pragma once
2
3#include <chrono>
4
5#include <userver/dynamic_config/snapshot.hpp>
6#include <userver/dynamic_config/value.hpp>
7#include <userver/formats/parse/to.hpp>
8#include <userver/storages/redis/impl/base.hpp>
9#include <userver/storages/redis/impl/wait_connected_mode.hpp>
10#include <userver/utils/retry_budget.hpp>
11
12USERVER_NAMESPACE_BEGIN
13
14namespace redis {
15CommandControl Parse(const formats::json::Value& elem, formats::parse::To<CommandControl>);
16
18
19WaitConnectedMode Parse(const formats::json::Value& elem, formats::parse::To<WaitConnectedMode>);
20
21RedisWaitConnected Parse(const formats::json::Value& elem, formats::parse::To<RedisWaitConnected>);
22
23CommandsBufferingSettings Parse(const formats::json::Value& elem, formats::parse::To<CommandsBufferingSettings>);
24
25MetricsSettings::DynamicSettings
26Parse(const formats::json::Value& elem, formats::parse::To<MetricsSettings::DynamicSettings>);
27
28ReplicationMonitoringSettings
29Parse(const formats::json::Value& elem, formats::parse::To<ReplicationMonitoringSettings>);
30
31PubsubMetricsSettings Parse(const formats::json::Value& elem, formats::parse::To<PubsubMetricsSettings>);
32} // namespace redis
33
34namespace storages::redis {
35
36struct Config final {
37 static Config Parse(const dynamic_config::DocsMap& docs_map);
38
39 USERVER_NAMESPACE::redis::CommandControl default_command_control;
40 USERVER_NAMESPACE::redis::CommandControl subscriber_default_command_control;
41 std::chrono::seconds subscriptions_rebalance_min_interval{};
42 USERVER_NAMESPACE::redis::RedisWaitConnected redis_wait_connected;
43 USERVER_NAMESPACE::redis::CommandsBufferingSettings commands_buffering_settings;
44 USERVER_NAMESPACE::redis::MetricsSettings::DynamicSettings metrics_settings;
45 USERVER_NAMESPACE::redis::PubsubMetricsSettings pubsub_metrics_settings;
46 dynamic_config::ValueDict<USERVER_NAMESPACE::redis::ReplicationMonitoringSettings> replication_monitoring_settings;
47 dynamic_config::ValueDict<USERVER_NAMESPACE::utils::RetryBudgetSettings> retry_budget_settings;
48};
49
50extern const dynamic_config::Key<Config> kConfig;
51
52} // namespace storages::redis
53
54USERVER_NAMESPACE_END