Skip to content
Google Go Redis RESP3 client
Go
Branch: master
Clone or download
Latest commit 19bb3be Dec 15, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
client fix golint Dec 15, 2019
cmd/rediser fix golint Dec 15, 2019
.gitignore Initial commit Nov 16, 2019
LICENSE Initial commit Nov 16, 2019
README.md add tests Dec 10, 2019
go.mod Initial commit Nov 16, 2019
go.sum Initial commit Nov 16, 2019

README.md

go-resp3

GoDoc Go Report Card

go-resp3 client is a Go implementation of the Redis RESP3 protocol. It is intended as a simple Go wrapper for Redis commands and is not going to support

  • former Redis protocols (RESP3 only).
  • Redis cluster protocol (allthough cluster commands are implemented) - please use Redis Cluster Proxy instead.

Installation

go get github.com/d024441/go-resp3/client

Building

To build go-resp3 you need to have a working Go environment with version 1.13.4 or higher installed.

Documentation

API documentation and documented examples can be found at https://godoc.org/github.com/d024441/go-resp3/client.

Tests

To run the driver tests and benchmarks a running Redis server (version >= 6.0) is required. For the Redis connection localhost (127.0.0.1) and the default Redis port is used. The following environment variables can be set to use alternative host and port addresses:

  • REDIS_HOST
  • REDIS_PORT

Features

  • Full RESP3 implementation supporting receiving attributes, streamed strings and streamed aggregate types.
  • Standardized generated command interface.
  • Asynchronous client with concurrent read / write supporting commands and out of band data within same connection.
  • Redis pipeline support.
  • Extendable via custom connection and pipeline (see https://godoc.org/github.com/d024441/go-resp3/client#ex-package--Redefine).

Edge cases

To simplify the command API some of the Redis commands got replaced by a set of commands:

Redis command Replaced by API commands
Bitop BitopAnd, BitopNot, BitopOr, BitopXor
Object ObjectEncoding, ObjectFreq, ObjectHelp, ObjectIdletime, ObjectRefcount
Pubsub PubsubChannels, PubsubNumpat, PubsubNumsub
Set Set, SetEx, SetExNx, SetExXx, SetNx, SetPx, SetPxNx, SetPxXx, SetXx
Slowlog SlowlogGet, SlowlogLen, SlowlogReset
Xgroup XgroupCreate, XgroupSetid, XgroupDestroy, XgroupDelconsumer, XgroupHelp
Xinfo XinfoConsumers, XinfoGroups, XinfoStream, XinfoHelp
Zadd Zadd, ZaddCh, ZaddNx, ZaddNxCh, ZaddXx, ZaddXxCh

Please see the following table for deprecated Redis commands and their replacements:

Redis command Replaced by API command
Hmset Hset
Setex SetEx
Setnx SetNx
Psetex SetPx
Zadd [INCR] Zincrby
Slaveof Replicaof

Dependencies

  • n/a

Todo

This is an alpha version. The client API may be subject to change until the first stable version is available.

  • Complete redis command tests.
You can’t perform that action at this time.