$ go get [-u] [-t] github.com/mna/redisc
v1.1.6 : Append the actual error messages when a refresh returns "all nodes failed" error.
v1.1.5 : Add
Cluster.PoolWaitTimeto configure the time to wait on a connection from a pool with
MaxActive> 0 and
Waitset to true (thanks to @iwanbk).
v1.1.4 : Add
Conn.ReceiveWithTimeoutto match redigo's
ConnWithTimeoutinterface (thanks to @letsfire).
v1.1.3 : Fix handling of
v1.1.2 : Remove mention that
Clusterstruct needs to be master nodes (it can be replicas). Add supporting test.
v1.1.1 : Fix CI tests.
v1.1.0 : This release builds with the
github.com/gomodule/redigopackage (the new import path of
redigo, which also has a breaking change in its
PMessagetype has been removed and consolidated into
v1.0.0 : This release builds with the
github.com/garyburd/redigopackage, which - according to its readme - will not be maintained anymore, having moved to
github.com/gomodule/redigofor future development. As such,
rediscwill not be updated with the old redigo package, this version was created only to avoid causing issues to users of redisc.
The godoc is the canonical source for documentation.
The design goal of redisc is to be as compatible as possible with the redigo package. As such, the
Cluster type can be used as a drop-in replacement to a
redis.Pool, and the connections returned by the cluster implement the
redis.Conn interface. The package offers additional features specific to dealing with a cluster that may be needed for more advanced scenarios.
The main features are:
- Drop-in replacement for
Clustertype implements the same
- Connections are
redis.Conninterfaces and use the
redigopackage to execute commands,
redisconly handles the cluster part.
- Support for all cluster-supported commands including scripting, transactions and pub-sub.
- Support for READONLY/READWRITE commands to allow reading data from replicas.
- Client-side smart routing, automatically keeps track of which node holds which key slots.
- Automatic retry of MOVED, ASK and TRYAGAIN errors when desired, via
- Manual handling of redirections and retries when desired, via
- Automatic detection of the node to call based on the command's first parameter (assumed to be the key).
- Explicit selection of the node to call via
- Support for optimal batch calls via
There are a number of ways you can support the project:
- Use it, star it, build something with it, spread the word!
- Raise issues to improve the project (note: doc typos and clarifications are issues too!)
- Please search existing issues before opening a new one - it may have already been adressed.
- Pull requests: please discuss new code in an issue first, unless the fix is really trivial.
- Make sure new code is tested.
- Be mindful of existing code - PRs that break existing code have a high probability of being declined, unless it fixes a serious issue.
If you desperately want to send money my way, I have a BuyMeACoffee.com page:
The BSD 3-Clause license.