2019-07-28 10:31:56 +08:00
|
|
|
|
#pragma once
|
2017-06-02 14:47:24 +08:00
|
|
|
|
#include "../acl_cpp_define.hpp"
|
2015-01-14 23:35:23 +08:00
|
|
|
|
#include <vector>
|
2017-06-02 14:47:24 +08:00
|
|
|
|
#include "../stdlib/string.hpp"
|
|
|
|
|
#include "redis_command.hpp"
|
2014-11-19 00:25:21 +08:00
|
|
|
|
|
2019-05-19 16:54:20 +08:00
|
|
|
|
#if !defined(ACL_CLIENT_ONLY) && !defined(ACL_REDIS_DISABLE)
|
2019-05-18 21:19:21 +08:00
|
|
|
|
|
2014-11-19 00:25:21 +08:00
|
|
|
|
namespace acl {
|
|
|
|
|
|
2019-07-28 10:31:56 +08:00
|
|
|
|
// redis <20><><EFBFBD><EFBFBD>֧<EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͷ<EFBFBD><CDB7><EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
// the data type supported by redis
|
2015-01-14 23:35:23 +08:00
|
|
|
|
typedef enum
|
|
|
|
|
{
|
2015-04-12 21:37:17 +08:00
|
|
|
|
REDIS_KEY_NONE, // none
|
2015-01-14 23:35:23 +08:00
|
|
|
|
REDIS_KEY_STRING, // string
|
|
|
|
|
REDIS_KEY_HASH, // hash
|
|
|
|
|
REDIS_KEY_LIST, // list
|
|
|
|
|
REDIS_KEY_SET, // set
|
|
|
|
|
REDIS_KEY_ZSET // sorted set
|
|
|
|
|
} redis_key_t;
|
|
|
|
|
|
2015-03-27 17:05:12 +08:00
|
|
|
|
class ACL_CPP_API redis_key : virtual public redis_command
|
2014-11-19 00:25:21 +08:00
|
|
|
|
{
|
|
|
|
|
public:
|
2015-03-29 19:27:41 +08:00
|
|
|
|
/**
|
|
|
|
|
* see redis_command::redis_command()
|
|
|
|
|
*/
|
2016-01-17 13:35:12 +08:00
|
|
|
|
redis_key(void);
|
2015-03-29 19:27:41 +08:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* see redis_command::redis_command(redis_client*)
|
|
|
|
|
*/
|
2015-03-27 17:05:12 +08:00
|
|
|
|
redis_key(redis_client* conn);
|
2015-03-29 19:27:41 +08:00
|
|
|
|
|
|
|
|
|
/**
|
2020-07-20 11:21:47 +08:00
|
|
|
|
* see redis_command::redis_command(redis_client_cluster*)
|
2015-03-29 19:27:41 +08:00
|
|
|
|
*/
|
2020-07-20 11:21:47 +08:00
|
|
|
|
redis_key(redis_client_cluster* cluster);
|
|
|
|
|
|
|
|
|
|
ACL_CPP_DEPRECATED
|
|
|
|
|
redis_key(redis_client_cluster* cluster, size_t max_conns);
|
2015-03-29 19:27:41 +08:00
|
|
|
|
|
2021-01-09 23:16:15 +08:00
|
|
|
|
redis_key(redis_client_pipeline* pipeline);
|
|
|
|
|
|
2016-01-17 13:35:12 +08:00
|
|
|
|
virtual ~redis_key(void);
|
2015-01-14 23:35:23 +08:00
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* ɾ<EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD> KEY<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><EFBFBD> NULL <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* delete one or some keys from redis, for deleting a variable
|
|
|
|
|
* number of keys, the last key must be NULL indicating the end
|
|
|
|
|
* of the variable args
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @return {int} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> KEY <EFBFBD>ĸ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>£<EFBFBD>
|
|
|
|
|
* 0: δɾ<EFBFBD><EFBFBD><EFBFBD>κ<EFBFBD> KEY
|
|
|
|
|
* -1: <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* >0: <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> KEY <EFBFBD>ĸ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD>п<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> KEY <EFBFBD>ĸ<EFBFBD><EFBFBD><EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* return the number of keys been deleted, return value as below:
|
|
|
|
|
* 0: none key be deleted
|
|
|
|
|
* -1: error happened
|
|
|
|
|
* >0: the number of keys been deleted
|
|
|
|
|
*
|
2015-01-14 23:35:23 +08:00
|
|
|
|
*/
|
2015-03-27 17:05:12 +08:00
|
|
|
|
int del_one(const char* key);
|
|
|
|
|
int del_one(const char* key, size_t len);
|
2015-12-03 17:00:07 +08:00
|
|
|
|
int del(const char* key);
|
2015-01-14 23:35:23 +08:00
|
|
|
|
int del(const std::vector<string>& keys);
|
|
|
|
|
int del(const std::vector<const char*>& keys);
|
|
|
|
|
int del(const char* keys[], size_t argc);
|
|
|
|
|
int del(const char* keys[], const size_t lens[], size_t argc);
|
2015-12-03 17:00:07 +08:00
|
|
|
|
int del_keys(const char* first_key, ...);
|
|
|
|
|
int del_keys(const std::vector<string>& keys);
|
|
|
|
|
int del_keys(const std::vector<const char*>& keys);
|
|
|
|
|
int del_keys(const char* keys[], size_t argc);
|
|
|
|
|
int del_keys(const char* keys[], const size_t lens[], size_t argc);
|
2015-01-14 23:35:23 +08:00
|
|
|
|
|
2015-01-21 23:39:02 +08:00
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD>л<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> key <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ر<EFBFBD><EFBFBD><EFBFBD><EFBFBD>л<EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>ʹ<EFBFBD><EFBFBD> RESTORE <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Խ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>л<EFBFBD>
|
|
|
|
|
* Ϊ Redis <EFBFBD><EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* serialize the object associate with the given key, and get the
|
|
|
|
|
* value after serializing, RESTORE command can be used to
|
|
|
|
|
* deserialize by the value
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @param key {const char*} <EFBFBD><EFBFBD>ֵ
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* the key
|
2020-05-19 12:47:50 +08:00
|
|
|
|
* @param len {size_t} key <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* the key's length
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @param out {string&} <EFBFBD>洢<EFBFBD><EFBFBD><EFBFBD>л<EFBFBD><EFBFBD>Ķ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* buffur used to store the result
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @return {int} <EFBFBD><EFBFBD><EFBFBD>л<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݳ<EFBFBD><EFBFBD><EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* the length of the data after serializing
|
2015-01-21 23:39:02 +08:00
|
|
|
|
*/
|
2020-05-19 12:47:50 +08:00
|
|
|
|
int dump(const char* key, size_t len, string& out);
|
2015-01-21 23:39:02 +08:00
|
|
|
|
int dump(const char* key, string& out);
|
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD>ж<EFBFBD> KEY <EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* check if the key exists in redis
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @param key {const char*} KEY ֵ
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* the key
|
2020-05-19 12:47:50 +08:00
|
|
|
|
* @param len {size_t} key <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* the key's length
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @return {bool} <EFBFBD><EFBFBD><EFBFBD><EFBFBD> true <EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* true returned if key existing, false if error or not existing
|
2015-01-21 23:39:02 +08:00
|
|
|
|
*/
|
2020-05-19 12:47:50 +08:00
|
|
|
|
bool exists(const char* key, size_t len);
|
2015-01-21 23:39:02 +08:00
|
|
|
|
bool exists(const char* key);
|
|
|
|
|
|
2015-01-14 23:35:23 +08:00
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD> KEY <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD><EFBFBD>룩
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* set a key's time to live in seconds
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @param key {const char*} <EFBFBD><EFBFBD>ֵ
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* the key
|
2020-05-19 12:47:50 +08:00
|
|
|
|
* @param len {size_t} key <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* the key's length
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @param n {int} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD><EFBFBD>룩
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* lief cycle in seconds
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @return {int} <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>£<EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* return value as below:
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* > 0: <EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* set successfully
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* 0<EFBFBD><EFBFBD><EFBFBD><EFBFBD> key <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* the key doesn't exist
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* < 0: <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* error happened
|
2015-01-14 23:35:23 +08:00
|
|
|
|
*/
|
2020-05-19 12:47:50 +08:00
|
|
|
|
int expire(const char* key, size_t len, int n);
|
2015-01-23 10:04:25 +08:00
|
|
|
|
int expire(const char* key, int n);
|
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD> UNIX ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> KEY <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* set the expiration for a key as a UNIX timestamp
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @param key {const char*} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* the key
|
2020-05-19 12:47:50 +08:00
|
|
|
|
* @param len {size_t} key <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* the key's length
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @param stamp {time_t} UNIX ʱ<EFBFBD><EFBFBD><EFBFBD>أ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1970 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* an absolute Unix timestamp (seconds since January 1, 1970).
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @return {int} <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD>ĺ<EFBFBD><EFBFBD>壺
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* return value:
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* 1: <EFBFBD><EFBFBD><EFBFBD>óɹ<EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* the timeout was set
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* 0: <EFBFBD><EFBFBD> key <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* the key doesn't exist or the timeout couldn't be set
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* -1: <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* error happened
|
2015-01-23 10:04:25 +08:00
|
|
|
|
*/
|
2020-05-19 12:47:50 +08:00
|
|
|
|
int expireat(const char* key, size_t len, time_t stamp);
|
2015-01-23 10:04:25 +08:00
|
|
|
|
int expireat(const char* key, time_t stamp);
|
2015-01-21 23:39:02 +08:00
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>з<EFBFBD><EFBFBD>ϸ<EFBFBD><EFBFBD><EFBFBD>ģʽ pattern <EFBFBD><EFBFBD> key
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* find all keys matching the given pattern
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @param pattern {const char*} ƥ<EFBFBD><EFBFBD>ģʽ
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* the give matching pattern
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @param out {std::vector<string>*} <EFBFBD><EFBFBD> NULL ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>洢<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* store the matched keys
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @return {int} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>0--Ϊ<EFBFBD>գ<EFBFBD><0 -- <EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* return the number of the matched keys, 0 if none, < 0 if error
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* ƥ<EFBFBD><EFBFBD>ģʽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* KEYS * ƥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> key <EFBFBD><EFBFBD>
|
|
|
|
|
* KEYS h?llo ƥ<EFBFBD><EFBFBD> hello <EFBFBD><EFBFBD> hallo <EFBFBD><EFBFBD> hxllo <EFBFBD>ȡ<EFBFBD>
|
|
|
|
|
* KEYS h*llo ƥ<EFBFBD><EFBFBD> hllo <EFBFBD><EFBFBD> heeeeello <EFBFBD>ȡ<EFBFBD>
|
|
|
|
|
* KEYS h[ae]llo ƥ<EFBFBD><EFBFBD> hello <EFBFBD><EFBFBD> hallo <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ƥ<EFBFBD><EFBFBD> hillo <EFBFBD><EFBFBD>
|
2015-01-30 22:58:13 +08:00
|
|
|
|
*
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <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><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* 1<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> get_value <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD><EFBFBD>±<EFBFBD><EFBFBD><EFBFBD>Ԫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2020-05-19 12:47:50 +08:00
|
|
|
|
* 2<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> get_child <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD><EFBFBD>±<EFBFBD><EFBFBD><EFBFBD>Ԫ<EFBFBD>ض<EFBFBD><EFBFBD><EFBFBD>(redis_result<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȼ<EFBFBD><EFBFBD>
|
|
|
|
|
* <EFBFBD><EFBFBD>ͨ<EFBFBD><EFBFBD> redis_result::argv_to_string <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ԫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* 3<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> get_result <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ȡ<EFBFBD><EFBFBD><EFBFBD>ܽ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> redis_result<EFBFBD><EFBFBD>Ȼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* ͨ<EFBFBD><EFBFBD> redis_result::get_child <EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD>Ԫ<EFBFBD>ض<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ 2
|
|
|
|
|
* <EFBFBD><EFBFBD>ָ<EFBFBD><EFBFBD><EFBFBD>ķ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ø<EFBFBD>Ԫ<EFBFBD>ص<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* 4<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> get_children <EFBFBD><EFBFBD><EFBFBD>ý<EFBFBD><EFBFBD><EFBFBD>Ԫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨ<EFBFBD><EFBFBD> redis_result
|
|
|
|
|
* <EFBFBD>еķ<EFBFBD><EFBFBD><EFBFBD> argv_to_string <EFBFBD><EFBFBD>ÿһ<EFBFBD><EFBFBD>Ԫ<EFBFBD>ض<EFBFBD><EFBFBD><EFBFBD><EFBFBD>л<EFBFBD><EFBFBD><EFBFBD>Ԫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* 5<EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD><EFBFBD>÷<EFBFBD><EFBFBD><EFBFBD><EFBFBD>д<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǿյĴ洢<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĵ<EFBFBD>ַ
|
2015-01-21 23:39:02 +08:00
|
|
|
|
*/
|
2015-01-30 22:58:13 +08:00
|
|
|
|
int keys_pattern(const char* pattern, std::vector<string>* out);
|
2015-01-23 17:23:04 +08:00
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݴ<EFBFBD>һ<EFBFBD><EFBFBD> redis-server Ǩ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD> redis-server
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* atomically transfer a key from a redis instance to another one
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @param key {const char*} <EFBFBD><EFBFBD><EFBFBD>ݶ<EFBFBD>Ӧ<EFBFBD>ļ<EFBFBD>ֵ
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* the key
|
2020-05-19 12:47:50 +08:00
|
|
|
|
* @param len {size_t} key <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* the key's length
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @param addr {const char*} Ŀ<EFBFBD><EFBFBD> redis-server <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʽ<EFBFBD><EFBFBD>ip:port
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* the destination redis instance's address, format: ip:port
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @param dest_db {unsigned} Ŀ<EFBFBD><EFBFBD> redis-server <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD> ID <EFBFBD><EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* the databases ID in destination redis
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @param timeout {unsigned} Ǩ<EFBFBD>ƹ<EFBFBD><EFBFBD>̵ij<EFBFBD>ʱʱ<EFBFBD><EFBFBD>(<EFBFBD><EFBFBD><EFBFBD>뼶)
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* timeout(microseconds) in transfering
|
2022-04-16 13:47:03 +08:00
|
|
|
|
* @param options {const char*} COPY/REPLACE/AUTH/AUTH2...
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* transfer option: COPY or REPLACE
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @return {bool} Ǩ<EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>ɹ<EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* if transfering successfully
|
2015-01-23 17:23:04 +08:00
|
|
|
|
*/
|
2020-05-19 12:47:50 +08:00
|
|
|
|
bool migrate(const char* key, size_t len, const char* addr,
|
2022-04-16 13:47:03 +08:00
|
|
|
|
unsigned dest_db, unsigned timeout, const char* options = NULL);
|
2015-01-23 17:23:04 +08:00
|
|
|
|
bool migrate(const char* key, const char* addr, unsigned dest_db,
|
2022-04-16 13:47:03 +08:00
|
|
|
|
unsigned timeout, const char* options = NULL);
|
|
|
|
|
bool migrate(const char* addr, unsigned dest_db, unsigned timeout,
|
|
|
|
|
const std::vector<const char*>& keys, std::vector<size_t>& lens,
|
|
|
|
|
const char* options = NULL);
|
2015-01-23 17:23:04 +08:00
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> redis-server <EFBFBD>е<EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD><EFBFBD><EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* move a key to another database
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @param key {const char*} <EFBFBD><EFBFBD><EFBFBD>ݼ<EFBFBD>ֵ
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* the key
|
2020-05-19 12:47:50 +08:00
|
|
|
|
* @param len {size_t} key <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* the key's length
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @param dest_db {unsigned} Ŀ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD> ID <EFBFBD><EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* the destination database
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @return {int} Ǩ<EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD>-1: <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>ͬ<EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>1<EFBFBD><EFBFBD>Ǩ<EFBFBD>Ƴɹ<EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* if moving succcessfully. -1 if error, 0 if moving failed because
|
|
|
|
|
* the same key already exists, 1 if successful
|
2015-01-23 17:23:04 +08:00
|
|
|
|
*/
|
2020-05-19 12:47:50 +08:00
|
|
|
|
int move(const char* key, size_t len, unsigned dest_db);
|
2015-01-23 17:23:04 +08:00
|
|
|
|
int move(const char* key, unsigned dest_db);
|
2015-01-21 23:39:02 +08:00
|
|
|
|
|
2015-01-25 21:03:20 +08:00
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD>ظ<EFBFBD><EFBFBD><EFBFBD> key <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><EFBFBD><EFBFBD>ڳ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* get the referring count of the object, which just for debugging
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @param key {const char*} <EFBFBD><EFBFBD><EFBFBD>ݼ<EFBFBD>ֵ
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* the key
|
2020-05-19 12:47:50 +08:00
|
|
|
|
* @param len {size_t} key <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* the key's length
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @return {int} <EFBFBD><EFBFBD><EFBFBD><EFBFBD> 0 <EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD> key <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD>< 0 <EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* 0 if key not exists, < 0 if error
|
2015-01-25 21:03:20 +08:00
|
|
|
|
*/
|
2020-05-19 12:47:50 +08:00
|
|
|
|
int object_refcount(const char* key, size_t len);
|
2015-01-25 21:03:20 +08:00
|
|
|
|
int object_refcount(const char* key);
|
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD>ظ<EFBFBD><EFBFBD><EFBFBD> key <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD>ʹ<EFBFBD>õ<EFBFBD><EFBFBD>ڲ<EFBFBD><EFBFBD><EFBFBD>ʾ
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* get the internal storing of the object assosicate with the key
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @param key {const char*} <EFBFBD><EFBFBD><EFBFBD>ݼ<EFBFBD>ֵ
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* the key
|
2020-05-19 12:47:50 +08:00
|
|
|
|
* @param len {size_t} key <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @param out {string&} <EFBFBD><EFBFBD><EFBFBD>ڽ<EFBFBD><EFBFBD><EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* store the result
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @return {bool} <EFBFBD>Ƿ<EFBFBD><EFBFBD>ɹ<EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* if successful
|
2015-01-25 21:03:20 +08:00
|
|
|
|
*/
|
2020-05-19 12:47:50 +08:00
|
|
|
|
bool object_encoding(const char* key, size_t len, string& out);
|
2015-01-25 21:03:20 +08:00
|
|
|
|
bool object_encoding(const char* key, string& out);
|
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD>ظ<EFBFBD><EFBFBD><EFBFBD> key <EFBFBD>Դ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ<EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>(idle<EFBFBD><EFBFBD> û<EFBFBD>б<EFBFBD><EFBFBD><EFBFBD>ȡҲû<EFBFBD>б<EFBFBD>д<EFBFBD><EFBFBD>)<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>λ
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* get the key's idle time in seconds since its first stored
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @param key {const char*} <EFBFBD><EFBFBD><EFBFBD>ݼ<EFBFBD>ֵ
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* the key
|
2020-05-19 12:47:50 +08:00
|
|
|
|
* @param len {size_t} key <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* the key's length
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @return {int} <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ < 0 <EFBFBD><EFBFBD>ʾ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* 0 if error happened
|
2015-01-25 21:03:20 +08:00
|
|
|
|
*/
|
2020-05-19 12:47:50 +08:00
|
|
|
|
int object_idletime(const char* key, size_t len);
|
2015-01-25 21:03:20 +08:00
|
|
|
|
int object_idletime(const char* key);
|
|
|
|
|
|
2015-01-23 10:04:25 +08:00
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD>Ƴ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> key <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD>䣬<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> key <EFBFBD><EFBFBD>"<EFBFBD><EFBFBD>ʧ<EFBFBD><EFBFBD>"(<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD> key )ת<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> key )
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* remove the expiration from a key
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @param key {const char*} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* the key
|
2020-05-19 12:47:50 +08:00
|
|
|
|
* @param len {size_t} key <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* the key's length
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @return {int} <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD>ĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>£<EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* the value returned as below:
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* 1 -- <EFBFBD><EFBFBD><EFBFBD>óɹ<EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* set ok
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* 0 -- <EFBFBD><EFBFBD> key <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڻ<EFBFBD>δ<EFBFBD><EFBFBD><EFBFBD>ù<EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* the key not exists or not be set expiration
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* -1 -- <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* error happened
|
2015-01-23 10:04:25 +08:00
|
|
|
|
*/
|
2020-05-19 12:47:50 +08:00
|
|
|
|
int persist(const char* key, size_t len);
|
2015-01-23 10:04:25 +08:00
|
|
|
|
int persist(const char* key);
|
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD> KEY <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룩
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* set a key's time to live in milliseconds
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @param key {const char*} <EFBFBD><EFBFBD>ֵ
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* the key
|
2020-05-19 12:47:50 +08:00
|
|
|
|
* @param len {size_t} key <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* the key's length
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @param n {int} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>룩
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* time to live in milliseconds
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @return {int} <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>£<EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* value returned as below:
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* > 0: <EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* set successfully
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* 0<EFBFBD><EFBFBD><EFBFBD><EFBFBD> key <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* the key doesn't exist
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* < 0: <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* error happened
|
2015-01-23 10:04:25 +08:00
|
|
|
|
*/
|
2020-05-19 12:47:50 +08:00
|
|
|
|
int pexpire(const char* key, size_t len, int n);
|
2015-01-23 10:04:25 +08:00
|
|
|
|
int pexpire(const char* key, int n);
|
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD>Ժ<EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> key <EFBFBD>Ĺ<EFBFBD><EFBFBD><EFBFBD> unix ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* set the expiration for a key as UNIX timestamp specified
|
|
|
|
|
* in milliseconds
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @param key {const char*} <EFBFBD><EFBFBD>ֵ
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* the key
|
2020-05-19 12:47:50 +08:00
|
|
|
|
* @param len {size_t} key <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* the key's length
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @param n {long long int} UNIX ʱ<EFBFBD><EFBFBD><EFBFBD>أ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1970 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĺ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* the UNIX timestamp in milliseconds from 1970.1.1
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @return {int} <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>£<EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* value resturned as below:
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* > 0: <EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* set successfully
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* 0<EFBFBD><EFBFBD><EFBFBD><EFBFBD> key <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* the key doesn't exist
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* < 0: <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* error happened
|
2015-01-23 10:04:25 +08:00
|
|
|
|
*/
|
2020-05-19 12:47:50 +08:00
|
|
|
|
int pexpireat(const char* key, size_t len, long long int n);
|
2015-01-23 10:04:25 +08:00
|
|
|
|
int pexpireat(const char* key, long long int n);
|
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD> KEY <EFBFBD><EFBFBD>ʣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룩
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* get the time to live for a key in milliseconds
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @param key {const char*} <EFBFBD><EFBFBD>ֵ
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* the key
|
2020-05-19 12:47:50 +08:00
|
|
|
|
* @param len {size_t} key <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* the key's length
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @return {int} <EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD>Ӧ<EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* value returned as below:
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* >0: <EFBFBD><EFBFBD> key ʣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>룩
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* the time to live for a key in milliseconds
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* -3<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* error happened
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* -2<EFBFBD><EFBFBD>key <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* the key doesn't exist
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* -1<EFBFBD><EFBFBD><EFBFBD><EFBFBD> key <EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʣ<EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* th key were not be set expiration
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* ע<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> redis-server 2.8 <EFBFBD><EFBFBD>ǰ<EFBFBD>汾<EFBFBD><EFBFBD>key <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD>δ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> -1
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* notice: for redis version before 2.8, -1 will be returned if the
|
|
|
|
|
* key doesn't exist or the key were not be set expiration.
|
2015-01-23 10:04:25 +08:00
|
|
|
|
*/
|
2020-05-19 12:47:50 +08:00
|
|
|
|
long long int pttl(const char* key, size_t len);
|
2015-01-23 10:04:25 +08:00
|
|
|
|
long long int pttl(const char* key);
|
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD>ӵ<EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><EFBFBD>)һ<EFBFBD><EFBFBD> key
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* return a random key from the keyspace
|
2019-07-28 10:31:56 +08:00
|
|
|
|
<EFBFBD><EFBFBD>@param buf {string&} <EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> KEY ʱ<EFBFBD>洢<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* store the key
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @return {bool} <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> key <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> false
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* true on success, or false be returned
|
2015-01-23 10:04:25 +08:00
|
|
|
|
*/
|
2019-09-20 18:40:16 +08:00
|
|
|
|
bool randomkey(string& buf);
|
2015-01-23 10:04:25 +08:00
|
|
|
|
|
2015-01-21 23:39:02 +08:00
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD> key <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ newkey
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* rename a key
|
2015-01-21 23:39:02 +08:00
|
|
|
|
* @return {bool}
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* true on success, or error happened
|
2015-01-21 23:39:02 +08:00
|
|
|
|
*/
|
|
|
|
|
bool rename_key(const char* key, const char* newkey);
|
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD>ҽ<EFBFBD><EFBFBD><EFBFBD> newkey <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> key <EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ newkey
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* rename a key only if the new key does not exist
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @param key {const char*} <EFBFBD><EFBFBD> key
|
|
|
|
|
* @param newkey {const char*} <EFBFBD><EFBFBD> key
|
|
|
|
|
* @return {int} <EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֵ > 0: <EFBFBD>ɹ<EFBFBD><EFBFBD><EFBFBD>0<EFBFBD><EFBFBD> Ŀ<EFBFBD><EFBFBD> key <EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD>< 0<EFBFBD><EFBFBD>ʧ<EFBFBD><EFBFBD>
|
2018-05-23 22:20:22 +08:00
|
|
|
|
* return value > 0 on success, < 0 on error, == 0 when newkey exists
|
2015-01-21 23:39:02 +08:00
|
|
|
|
*/
|
2018-05-23 22:20:22 +08:00
|
|
|
|
int renamenx(const char* key, const char* newkey);
|
2015-01-21 23:39:02 +08:00
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <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><EFBFBD><EFBFBD><EFBFBD> key <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* create a key using the provided serialized value, previously
|
|
|
|
|
* obtained by using DUMP
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @param ttl {int} <EFBFBD>Ժ<EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>λΪ key <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD>䣬<EFBFBD><EFBFBD><EFBFBD><EFBFBD> ttl Ϊ 0<EFBFBD><EFBFBD>
|
|
|
|
|
* <EFBFBD><EFBFBD>ô<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* the time to live for the key in milliseconds, if tll is 0,
|
|
|
|
|
* expiration will not be set
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @param replace {bool} <EFBFBD><EFBFBD><EFBFBD><EFBFBD> key <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD>ֱ<EFBFBD>Ӹ<EFBFBD><EFBFBD><EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* if the key already exists, this parameter decides if replacing
|
|
|
|
|
* the existing key
|
2015-01-21 23:39:02 +08:00
|
|
|
|
* @return {bool}
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* true on success, false on error
|
2015-01-21 23:39:02 +08:00
|
|
|
|
*/
|
|
|
|
|
bool restore(const char* key, const char* value, size_t len,
|
|
|
|
|
int ttl, bool replace = false);
|
2015-01-14 23:35:23 +08:00
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD> KEY <EFBFBD><EFBFBD>ʣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD><EFBFBD><EFBFBD>λ<EFBFBD><EFBFBD><EFBFBD>룩
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* get the time to live for a key in seconds
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @param key {const char*} <EFBFBD><EFBFBD>ֵ
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* the key
|
2020-05-19 12:47:50 +08:00
|
|
|
|
* @param len {size_t} key <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* the key's length
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @return {int} <EFBFBD><EFBFBD><EFBFBD>ض<EFBFBD>Ӧ<EFBFBD><EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* return value as below:
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* > 0: <EFBFBD><EFBFBD> key ʣ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD><EFBFBD>룩
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* the time to live for a key in seconds
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* -3<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* error happened
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* -2<EFBFBD><EFBFBD>key <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* the key doesn't exist
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* -1<EFBFBD><EFBFBD><EFBFBD><EFBFBD> key <EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD>û<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʣ<EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* the key were not be set expiration
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* ע<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> redis-server 2.8 <EFBFBD><EFBFBD>ǰ<EFBFBD>汾<EFBFBD><EFBFBD>key <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڻ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD>δ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> -1
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* notice: for the redis version before 2.8, -1 will be returned
|
|
|
|
|
* if the key doesn't exist or the key were not be set expiration
|
2015-01-14 23:35:23 +08:00
|
|
|
|
*/
|
2020-05-19 12:47:50 +08:00
|
|
|
|
int ttl(const char* key, size_t len);;
|
2015-01-23 17:23:04 +08:00
|
|
|
|
int ttl(const char* key);
|
2015-01-14 23:35:23 +08:00
|
|
|
|
|
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD> KEY <EFBFBD>Ĵ洢<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* get the the type stored at key
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @para key {const char*} KEY ֵ
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* the key
|
2020-05-19 12:47:50 +08:00
|
|
|
|
* @param len {size_t} key <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
|
|
* the key's length
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @return {redis_key_t} <EFBFBD><EFBFBD><EFBFBD><EFBFBD> KEY <EFBFBD>Ĵ洢<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* return redis_key_t defined above as REDIS_KEY_
|
2015-01-14 23:35:23 +08:00
|
|
|
|
*/
|
2020-05-19 12:47:50 +08:00
|
|
|
|
redis_key_t type(const char* key, size_t len);
|
2015-01-14 23:35:23 +08:00
|
|
|
|
redis_key_t type(const char* key);
|
|
|
|
|
|
2015-01-21 23:39:02 +08:00
|
|
|
|
/**
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD><EFBFBD>е<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD><EFBFBD><EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* incrementally iterate the keys space in the specified database
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @param cursor {int} <EFBFBD>α<EFBFBD>ֵ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʼ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>ֵд 0
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* the iterating cursor beginning with 0
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @param out {std::vector<acl::string>&} <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><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><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><EFBFBD>ñ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǰ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* string array storing the results, the array will be cleared
|
|
|
|
|
* internal and the string result will be appened to the array
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @param pattern {const char*} ƥ<EFBFBD><EFBFBD>ģʽ<EFBFBD><EFBFBD>glob <EFBFBD><EFBFBD><EFBFBD>ǿ<EFBFBD>ʱ<EFBFBD><EFBFBD>Ч
|
2015-04-12 21:37:17 +08:00
|
|
|
|
& the matching pattern with glob style, only effective if not NULL
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @param count {const size_t*} <EFBFBD><EFBFBD><EFBFBD>Ľ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ǿ<EFBFBD>ָ<EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD>Ч
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* limit the max number of the results stored in array, only
|
|
|
|
|
* effective when not NULL
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* @return {int} <EFBFBD><EFBFBD>һ<EFBFBD><EFBFBD><EFBFBD>α<EFBFBD>λ<EFBFBD>ã<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>£<EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* return the next cursor value as follow:
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* 0<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><EFBFBD><EFBFBD><EFBFBD> out <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><EFBFBD><EFBFBD>д<EFBFBD><EFBFBD><EFBFBD>
|
2019-03-28 11:18:10 +08:00
|
|
|
|
* iterating is finished and the out should be checked if emtpy
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* -1: <EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* some error happened
|
2019-07-28 10:31:56 +08:00
|
|
|
|
* >0: <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><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ҫ<EFBFBD><EFBFBD><EFBFBD><EFBFBD> out<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD>п<EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD>
|
2015-04-12 21:37:17 +08:00
|
|
|
|
* the next cursor value for iterating
|
2015-01-21 23:39:02 +08:00
|
|
|
|
*/
|
2015-01-23 17:23:04 +08:00
|
|
|
|
int scan(int cursor, std::vector<string>& out,
|
|
|
|
|
const char* pattern = NULL, const size_t* count = NULL);
|
2014-11-19 00:25:21 +08:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace acl
|
2019-05-18 21:19:21 +08:00
|
|
|
|
|
2019-05-19 16:54:20 +08:00
|
|
|
|
#endif // !defined(ACL_CLIENT_ONLY) && !defined(ACL_REDIS_DISABLE)
|