xRedis API  1.1
The C++ Client API for Redis server
xRedis API Documentation

xRedis

Author
xSky

Redis C++ client, support the data slice storage, support the connection pool

Features:


1. data slice storage
2. connection pool
3. connection to multiple clusters
4. most REDIS commands have been implemented
5. multi thread safety

github

https://github.com/0xsky/xredis

Dependencies

xRedis requires hiredis only

Install

First step install libhiredis, on a Debian/Ubuntu system you can use:

1 sudo apt-get install libhiredis-dev

on a Redhat/Centos system you can use:

1 sudo yum install hiredis-devel

Then checkout the code and compile it

1 git clone https://github.com/0xsky/xredis
2 cd xredis/src
3 make
4 sudo make install

Documentation

xRedis Architecture diagram
xRedis开源社区群

example:

RedisNode RedisAddr[1]={ {0,"127.0.0.1", 6379, "", 8, 5} };
xRedisClient xRedis;
xRedis.Init();
xRedis.ConnectRedisCache(RedisAddr, 1, CACHE_TYPE_1);
const char *key = "test";
const char *value = "test value";
RedisDBIdx dbi(&xClient);
dbi.CreateDBIndex(key, APHash, CACHE_TYPE_1);
bool bRet = xClient.set(dbi, key, value)
if(bRet){
printf("success \r\n");
} else {
printf("error [%s] \r\n", dbi.GetErrInfo());
}

See examples directory for more examples
xRedis QQ Group: 190107312 xRedis开源社区群

Donate xRedis


Generated on Fri Oct 23 2015 13:13:57 for xRedis API version 1.1.