go-redis-client Redis 的 Go 客户端开发包开源项目

我要开发同款
匿名用户2019年05月16日
80阅读
开发技术GO语言
所属分类Google Go、数据库驱动程序、数据库相关
授权协议MIT

作品详情

go-redis-client是国内团队灵雀云开发的Go语言的Redis客户端开发包,支持Redis单机和集群。

特性自动键前缀创建客户端实例时使用独立的参数对象内部使用github.com/go-redis/redis客户端,当前使用的是gopkg.in/redis.v5客户端接口示例packagemainimport"redis"github.com/alauda/go-redis-clientfuncmain(){//checkoptions.goformoredetailsopts:=redis.RedisClientOptions{Type:redis.ClientNormal,Hosts:[]string{"localhost:6379"},Password:"123456",Database:0,}client:=redis.NewRedisClient(opts)iferr:=client.Ping().Err();err!=nil{panic(err)}//UsingclustermodeclusterOpts:=redis.RedisClientOptions{Type:redis.ClientCluster,Hosts:[]string{"localhost:7000","localhost:7001","localhost:7002"},Password:"123456",Database:0,//allkeyswithaprefixKeyPrefix:"my-app:",}clusterClient:=redis.NewRedisClient(clusterOpts)iferr:=clusterClient.Ping().Err();err!=nil{panic(err)}}SupportedcommandsPingIncrIncrByDecrDecrByExpireExpireAtPersistPExpirePExpireAtPTTLTTLExistsGetGetBitGetRangeGetSetMGetDumpHExistsHGetHGetAllHIncrByHIncrByFloatHKeysHLenHMGetHMSetHSetHSetNXHValsLIndexLInsertLInsertAfterLInsertBeforeLLenLPopLPushLPushXLRangelRemLSetLTrimRPopRPopLPushRPushRPushXSetAppendDelUnlinkSAddSCardSDiffSDiffStoreSInterSInterStoreSIsMemberSMembersSMoveSPopSPopNSRandMemberSRemSUnionSUnionStoreZAddZAddNXZAddXXZAddChZaddNXChZIncrZIncrNXZIncrXXZCardZCountZIncrByZInterStoreZRangeZRangeWithScoresZRangeByScoreZRangeByLexZRangeByScoreWithScoresZRankZRemZREmRangeByRankZRemRangeByScoreZRemRangeByLexZRevRangeZRevRangeWithScoresZRevRangeByScoreZRevRangeByLexZRevRangeByScoreWithScoresZRevRankZScoreZUnionStoreBLPopBRPopBRPopLPushTypeScanSScanZScanHScanPublishSubscribeTODO Updatetoredis.v6 SupportRedisClusterSubscribe Bettersupportforgodoc Adddocker-composeandexampleapplication Addtests
声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论