Git Product home page Git Product logo

radix.v2's Introduction

Radix

Build Status GoDoc

Radix is a minimalistic Redis client for Go. It is broken up into small, single-purpose packages for ease of use.

  • redis - A wrapper around a single, non-thread-safe redis connection. Supports normal commands/response as well as pipelining.

  • pool - a simple, automatically expanding/cleaning connection pool. If you have multiple go-routines using the same redis instance you'll need this.

  • pubsub - a simple wrapper providing convenient access to Redis Pub/Sub functionality.

  • sentinel - a client for redis sentinel which acts as a connection pool for a cluster of redis nodes. A sentinel client connects to a sentinel instance and any master redis instances that instance is monitoring. If a master becomes unavailable, the sentinel client will automatically start distributing connections from the slave chosen by the sentinel instance.

  • cluster - a client for a redis cluster which automatically handles interacting with a redis cluster, transparently handling redirects and pooling. This client keeps a mapping of slots to nodes internally, and automatically keeps it up-to-date.

  • util - a package containing a number of helper methods for doing common tasks with the radix package, such as SCANing either a single redis instance or every one in a cluster, or executing server-side lua

V3

If you're so inclined, radix.v3 is available for beta testing. If you like v2 you'll probably love v3, it's got everything v2 does and is faster, cleaner, and more flexible. Check it out!

Installation

go get github.com/mediocregopher/radix.v2/...

Testing

go test github.com/mediocregopher/radix.v2/...

The test action assumes you have the following running:

  • A redis server listening on port 6379

  • A redis cluster node listening on port 7000, handling slots 0 through 8191

  • A redis cluster node listening on port 7001, handling slots 8192 through 16383

  • A redis server listening on port 8000

  • A redis server listening on port 8001, slaved to the one on 8000

  • A redis sentinel listening on port 28000, watching the one on port 8000 as a master named test.

The slot number are particularly important as the tests for the cluster package do some trickery which depends on certain keys being assigned to certain nodes

You can do make start and make stop to automatically start and stop a test environment matching these requirements.

Why is this V2?

V1 of radix was started by fzzy and can be found here. Some time in 2014 I took over the project and reached a point where I couldn't make improvements that I wanted to make due to past design decisions (mostly my own). So I've started V2, which has redesigned some core aspects of the api and hopefully made things easier to use and faster.

Here are some of the major changes since V1:

  • Combining resp and redis packages

  • Reply is now Resp

  • Hash is now Map

  • Append is now PipeAppend, GetReply is now PipeResp

  • PipelineQueueEmptyError is now ErrPipelineEmpty

  • Significant changes to pool, making it easier to use

  • More functionality in cluster

Copyright and licensing

Unless otherwise noted, the source files are distributed under the MIT License found in the LICENSE.txt file.

radix.v2's People

Contributors

bpowers avatar chzyer avatar eloycoto avatar fabiokung avatar hayesgm avatar imkira avatar kixelated avatar lithograph avatar mlaoji avatar mstoykov avatar nilslice avatar ulfurinn avatar vharitonsky avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.