3 Star 4 Fork 3

xSky / libredis-client

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

libredis-client

Build Status License GitHub version

C++ Redis client, support redis cluster, connection pool.

Features:

  • suppert redis cluster, no data move needed
  • connection pool
  • thread safe
  • suport linux and windows

中文版说明文档点这里

Dependencies

requires hiredis only

Install

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

sudo apt-get install libhiredis-dev

on centos/redhat/fedora system you can use:

sudo yum install hiredis-devel

Then checkout the code and compile it

git clone https://github.com/0xsky/libredis-client
cd libredis-client
make
sudo make install

Usage

#Accessing redis or  redis Cluster 

#include "libredis-client.h"
int main(int argc, char **argv) {
    RedisClient redisclient;
    # Connect to REDIS and establish a connection pool 
    # If this node is a member of the REDIS cluster, 
    # a connection pool is automatically established for each master node.
    redisclient.ConnectRedis("127.0.0.1", 6379, 4);

    RedisResult result;
    redisclient.Command(result, "set %s %s", "key", "hello");
    
    printf("type:%d integer:%lld str:%s \r\n",
        result.type(), result.integer(), result.str());

    return 0;
}

Blog: xSky's Blog

Redis QQ Group: 190107312

空文件

简介

Redis C++ client, suppert redis cluster, requires hiredis only 展开 收起
C++ 等 3 种语言
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
C++
1
https://gitee.com/0xsky/libredis-client.git
git@gitee.com:0xsky/libredis-client.git
0xsky
libredis-client
libredis-client
master

搜索帮助