Loading...
Searching...
No Matches
config.hpp
/* Copyright (c) 2018-2024 Marcelo Zimbres Silva (mzimbres@gmail.com)
*
* Distributed under the Boost Software License, Version 1.0. (See
* accompanying file LICENSE.txt)
*/
#ifndef BOOST_REDIS_CONFIG_HPP
#define BOOST_REDIS_CONFIG_HPP
#include <string>
#include <chrono>
#include <optional>
namespace boost::redis
{
struct address {
std::string host = "127.0.0.1";
std::string port = "6379";
};
struct config {
bool use_ssl = false;
address addr = address{"127.0.0.1", "6379"};
std::string username = "default";
std::string password;
std::string clientname = "Boost.Redis";
std::optional<int> database_index = 0;
std::string health_check_id = "Boost.Redis";
std::string log_prefix = "(Boost.Redis) ";
std::chrono::steady_clock::duration resolve_timeout = std::chrono::seconds{10};
std::chrono::steady_clock::duration connect_timeout = std::chrono::seconds{10};
std::chrono::steady_clock::duration ssl_handshake_timeout = std::chrono::seconds{10};
std::chrono::steady_clock::duration health_check_interval = std::chrono::seconds{2};
std::chrono::steady_clock::duration reconnect_wait_interval = std::chrono::seconds{1};
};
} // boost::redis
#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