# redis **Repository Path**: ikangbow/redis ## Basic Information - **Project Name**: redis - **Description**: redis cpp library. - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 3 - **Created**: 2025-03-04 - **Last Updated**: 2025-03-04 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # redis ## 介绍 redis cpp库,其内部有连接池,支持多线程访问。 ### 实例 ``` cpp int main() { try { // redis connect to localhost:6379 and 0 index for 10 redis connections' pool redisSpace::RedisClient redis("localhost", 6379, 0, 0, 10); // hset command. redis.HSet("abc", "1", "1"); redis.HSet("abc", "2", "2"); // hget command. auto g = redis.HGet("abc", "1"); // hgetall command. auto &res = redis.HGetAll("abc"); if (res.first && res.second.type == redisSpace::RedisResultType_StringMap) { auto &m = res.second.mapResult; for (auto it = m.begin(); it != m.end();it++) { ; } } // exists command. auto e = redis.Exists("abc"); // hdel command. auto hdel = redis.HDel("abc", "1"); auto gg = redis.HGet("abc", "1"); return 0; } catch (...) { return -1; } }