-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathredis.h
35 lines (26 loc) · 830 Bytes
/
redis.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#ifndef __CREDIS_H__
#define __CREDIS_H__
#include "hiredis.h"
class CRedis {
public:
CRedis();
~CRedis();
public:
int connect_redis(const char* host, unsigned int port, unsigned short second = 0);
int get_value(const char* key);
int set_value(const char* key, const char* value);
int set_expire(const char* key, int expire);
int Enqueue(const char* queue, const char* value);
int Dequeue(const char* queue);
int S_IsMember(const char* key, const char* value);
int S_IsMember(const char* key, const int value);
int HSet(const char* key, const int field, const char* value);
int HGet(const char* key, const int field);
int HDel(const char* key, const int field);
int Del(const char* key);
bool IsActived();
private:
redisContext* m_redis;
redisReply* m_reply;
};
#endif