Boost.Redis 1.84.0 A redis client library

Loading...
Searching...
No Matches
config.hpp
1/* Copyright (c) 2018-2024 Marcelo Zimbres Silva (mzimbres@gmail.com)
2 *
3 * Distributed under the Boost Software License, Version 1.0. (See
4 * accompanying file LICENSE.txt)
5 */
6
7#ifndef BOOST_REDIS_CONFIG_HPP
8#define BOOST_REDIS_CONFIG_HPP
9
10#include <string>
11#include <chrono>
12#include <optional>
13
14 namespace boost::redis
15{
16
20 struct address {
22 std::string host = "127.0.0.1";
24 std::string port = "6379";
25};
26
30 struct config {
32 bool use_ssl = false;
33
35 address addr = address{"127.0.0.1", "6379"};
36
41 std::string username = "default";
42
47 std::string password;
48
50 std::string clientname = "Boost.Redis";
51
53 std::optional<int> database_index = 0;
54
56 std::string health_check_id = "Boost.Redis";
57
59 std::string log_prefix = "(Boost.Redis) ";
60
62 std::chrono::steady_clock::duration resolve_timeout = std::chrono::seconds{10};
63
65 std::chrono::steady_clock::duration connect_timeout = std::chrono::seconds{10};
66
68 std::chrono::steady_clock::duration ssl_handshake_timeout = std::chrono::seconds{10};
69
74 std::chrono::steady_clock::duration health_check_interval = std::chrono::seconds{2};
75
80 std::chrono::steady_clock::duration reconnect_wait_interval = std::chrono::seconds{1};
81};
82
83} // boost::redis
84
85#endif // BOOST_REDIS_CONFIG_HPP
boost::redis::config::addr
address addr
Address of the Redis server.
Definition: config.hpp:35
boost::redis::config::clientname
std::string clientname
Client name parameter of the HELLO command.
Definition: config.hpp:50
boost::redis::config::health_check_id
std::string health_check_id
Message used by the health-checker in boost::redis::connection::async_run.
Definition: config.hpp:56
boost::redis::config::password
std::string password
Password passed to the HELLO command. If left empty HELLO will be sent without authentication paramet...
Definition: config.hpp:47
boost::redis::address::port
std::string port
Redis port.
Definition: config.hpp:24
boost::redis::config::reconnect_wait_interval
std::chrono::steady_clock::duration reconnect_wait_interval
Time waited before trying a reconnection.
Definition: config.hpp:80
boost::redis::config::database_index
std::optional< int > database_index
Database that will be passed to the SELECT command.
Definition: config.hpp:53
boost::redis::config::ssl_handshake_timeout
std::chrono::steady_clock::duration ssl_handshake_timeout
Time the SSL handshake operation is allowed to last.
Definition: config.hpp:68
boost::redis::config::health_check_interval
std::chrono::steady_clock::duration health_check_interval
Definition: config.hpp:74
boost::redis::config::use_ssl
bool use_ssl
Uses SSL instead of a plain connection.
Definition: config.hpp:32
boost::redis::config::connect_timeout
std::chrono::steady_clock::duration connect_timeout
Time the connect operation is allowed to last.
Definition: config.hpp:65
boost::redis::config::resolve_timeout
std::chrono::steady_clock::duration resolve_timeout
Time the resolve operation is allowed to last.
Definition: config.hpp:62
boost::redis::config::log_prefix
std::string log_prefix
Logger prefix, see boost::redis::logger.
Definition: config.hpp:59
boost::redis::config::username
std::string username
Username passed to the HELLO command. If left empty HELLO will be sent without authentication paramet...
Definition: config.hpp:41
boost::redis::address::host
std::string host
Redis host.
Definition: config.hpp:22
boost::redis::address
Address of a Redis server.
Definition: config.hpp:20
boost::redis::config
Configure parameters used by the connection classes.
Definition: config.hpp:30