2013-08-18 17:42:25 +08:00
|
|
|
#pragma once
|
|
|
|
#include <vector>
|
|
|
|
#include "acl_cpp/stdlib/string.hpp"
|
|
|
|
|
|
|
|
namespace acl {
|
|
|
|
|
|
|
|
class redis_key
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
redis_key() {}
|
|
|
|
~redis_key() {}
|
|
|
|
|
2013-11-05 22:23:23 +08:00
|
|
|
#ifdef WIN32
|
2013-08-18 17:42:25 +08:00
|
|
|
bool del_keys(const char* first_key, ...);
|
2013-11-05 22:23:23 +08:00
|
|
|
#else
|
|
|
|
bool del_keys(const char* first_key, ...)
|
|
|
|
__attribute__((format(printf, 2, 3)));
|
|
|
|
#endif
|
2013-08-18 17:42:25 +08:00
|
|
|
int get_keys(const char* pattern, std::vector<acl::string>& out);
|
|
|
|
bool if_exists(const char* key);
|
|
|
|
redis_key_t get_key_type(const char* key);
|
|
|
|
bool set_ttl(const char* key, int n);
|
|
|
|
int get_ttl(const char* key);
|
|
|
|
bool set_expireat(const char* key, time_t stamp);
|
|
|
|
bool set_persist(const char*);
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace acl
|