2015-03-27 17:05:12 +08:00
|
|
|
|
#pragma once
|
2017-06-02 14:47:24 +08:00
|
|
|
|
#include "../acl_cpp_define.hpp"
|
|
|
|
|
#include "redis_connection.hpp"
|
|
|
|
|
#include "redis_hash.hpp"
|
|
|
|
|
#include "redis_hyperloglog.hpp"
|
|
|
|
|
#include "redis_key.hpp"
|
|
|
|
|
#include "redis_list.hpp"
|
|
|
|
|
#include "redis_pubsub.hpp"
|
|
|
|
|
#include "redis_script.hpp"
|
|
|
|
|
#include "redis_server.hpp"
|
|
|
|
|
#include "redis_set.hpp"
|
|
|
|
|
#include "redis_string.hpp"
|
|
|
|
|
#include "redis_transaction.hpp"
|
|
|
|
|
#include "redis_zset.hpp"
|
|
|
|
|
#include "redis_cluster.hpp"
|
|
|
|
|
#include "redis_geo.hpp"
|
2018-11-16 13:28:55 +08:00
|
|
|
|
#include "redis_stream.hpp"
|
2015-03-27 17:05:12 +08:00
|
|
|
|
|
2019-05-18 21:19:21 +08:00
|
|
|
|
#ifndef ACL_CLIENT_ONLY
|
|
|
|
|
|
2015-03-27 17:05:12 +08:00
|
|
|
|
namespace acl
|
|
|
|
|
{
|
|
|
|
|
|
2015-03-29 19:27:41 +08:00
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>̳<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> redis <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>࣬<EFBFBD><EFBFBD><EFBFBD>˿<EFBFBD><EFBFBD><EFBFBD>ֻͨ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>е<EFBFBD> redis <EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* inherit all the redis command class, which include all the commands
|
|
|
|
|
* of Key, String, Hash, List, Set, SortedSet, Hyperloglog, Pub/Sub,
|
|
|
|
|
* Transaction, Script, Connection, Server.
|
|
|
|
|
*/
|
2015-03-27 17:05:12 +08:00
|
|
|
|
class ACL_CPP_API redis
|
|
|
|
|
: public redis_connection
|
|
|
|
|
, public redis_hash
|
|
|
|
|
, public redis_hyperloglog
|
|
|
|
|
, public redis_key
|
|
|
|
|
, public redis_list
|
|
|
|
|
, public redis_pubsub
|
|
|
|
|
, public redis_script
|
|
|
|
|
, public redis_server
|
|
|
|
|
, public redis_set
|
|
|
|
|
, public redis_string
|
|
|
|
|
, public redis_transaction
|
|
|
|
|
, public redis_zset
|
2015-04-02 22:19:57 +08:00
|
|
|
|
, public redis_cluster
|
2015-07-13 16:28:09 +08:00
|
|
|
|
, public redis_geo
|
2018-11-16 13:28:55 +08:00
|
|
|
|
, public redis_stream
|
2015-03-27 17:05:12 +08:00
|
|
|
|
{
|
|
|
|
|
public:
|
2015-09-27 20:59:21 +08:00
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD>Ǽ<EFBFBD>Ⱥ<EFBFBD><EFBFBD>ʽ<EFBFBD>Ĺ<EFBFBD><EFBFBD>캯<EFBFBD><EFBFBD>
|
|
|
|
|
* the constructor with no redis cluster
|
|
|
|
|
* @param conn {redis_client*} һ<EFBFBD><EFBFBD> redis <EFBFBD>ڵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӷ<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* one redis node's connection
|
|
|
|
|
*/
|
2015-03-27 17:05:12 +08:00
|
|
|
|
redis(redis_client* conn = NULL);
|
2015-09-27 20:59:21 +08:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* <EFBFBD><EFBFBD>Ⱥ<EFBFBD><EFBFBD>ʽ<EFBFBD>Ĺ<EFBFBD><EFBFBD>캯<EFBFBD><EFBFBD>
|
|
|
|
|
* the constructor in redis cluster mode
|
|
|
|
|
* @param cluster {redis_client_cluster*} <EFBFBD><EFBFBD>Ⱥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* the redis cluster object
|
|
|
|
|
* @param max_conns {size_t} <EFBFBD><EFBFBD>Ⱥ<EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ÿ<EFBFBD><EFBFBD> redis <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD>ӳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ޣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ 0<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ÿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ӳ<EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* the limit of each connections pool in redis cluster mode,
|
|
|
|
|
* there is no connections limit of each pool if the max_conns
|
|
|
|
|
* is set to 0.
|
|
|
|
|
*/
|
|
|
|
|
redis(redis_client_cluster* cluster, size_t max_conns = 0);
|
2016-04-01 09:36:18 +08:00
|
|
|
|
|
2016-01-17 13:35:12 +08:00
|
|
|
|
~redis(void) {}
|
2015-03-27 17:05:12 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace acl
|
2019-05-18 21:19:21 +08:00
|
|
|
|
|
|
|
|
|
#endif // ACL_CLIENT_ONLY
|