Skip to content
This repository

Google Go Client and Connectors for Redis

Octocat-spinner-32 bench MOD (extensive) - properly support QUIT for async clients -- TESTED September 14, 2012
Octocat-spinner-32 compliance MOD (extensive) - properly support QUIT for async clients -- TESTED September 14, 2012
Octocat-spinner-32 examples ADD PubSub - support PubSub PUBLISH - TESTED September 17, 2012
Octocat-spinner-32 test NOP TESTS - move client tests to test/ - TESTED September 24, 2012
Octocat-spinner-32 .gitignore Remove unnecessary Timer & Signal in future.go - ADHOC TESTED February 13, 2012
Octocat-spinner-32 LICENSE initial commit November 14, 2009
Octocat-spinner-32 NOTICE update NOTICE file. April 18, 2012
Octocat-spinner-32 README.markdown NOP update README May 11, 2012
Octocat-spinner-32 asynchclient.go REFACT - extensive - Cleanup connection cruft from 2009 - TESTED September 17, 2012
Octocat-spinner-32 changelog minor cleanup & update to go r60.1 compliant with redis 2.2.13 - TESTED September 21, 2011
Octocat-spinner-32 compliance_note.txt NOP - updated info files for Go 1 release March 30, 2012
Octocat-spinner-32 connection.go MOD - cleanup error handling - TESTED September 24, 2012
Octocat-spinner-32 connection_test.go NOP MOD - Review top level test code -- TESTED September 20, 2012
Octocat-spinner-32 error.go NOP - remove debug code September 24, 2012
Octocat-spinner-32 error_test.go API CHANGE - Cleanup Error - TESTED September 23, 2012
Octocat-spinner-32 future.go Clarified the semantics of the TryGet funcs in futures - ADHOC TESTED February 13, 2012
Octocat-spinner-32 future_test.go NOP MOD - Review top level test code -- TESTED September 20, 2012
Octocat-spinner-32 protocol.go NOP - do not export unnecessary consts - TESTED September 24, 2012
Octocat-spinner-32 pubsubclient.go API CHANGE - Cleanup Error - TESTED September 23, 2012
Octocat-spinner-32 redis.go ADD WIP - PubSubConnection impl - ADHOC TESTED September 21, 2012
Octocat-spinner-32 redisfutures.go Clarified the semantics of the TryGet funcs in futures - ADHOC TESTED February 13, 2012
Octocat-spinner-32 specification.go WIP - PubSub working; WIP is timeout (general) and PSUB/PUNSUB - ADHO… September 23, 2012
Octocat-spinner-32 synchclient.go API CHANGE - Cleanup Error - TESTED September 23, 2012
README.markdown

Go-Redis

Go Clients and Connectors for Redis.

The initial release provides the interface and implementation supporting the (~) full set of current Redis commands using synchrnous call semantics. (Pipelines and asychronous goodness using the goroutines and channels is next.)

Hope to add rigorous tests as soon as I have a better understanding of the Go language tools. Same applies to the makefile.
Also am not sure regarding the efficiency of the implementation (for the obvious reasons), but definitely a goal is to make this a high performance connector.

structure

The code is consolidated into a single 'redis' package and various elements of it are usable independently (for example if you wish to roll your own API but want to use the raw bytes protocol handling aspects).

Compliance

Both Go and Redis are dynamic projects and present a challenge in fully covering the possible combinations in the wild. Given the release of Go 1, this project will focus on Go 1 based Redis compatibility; we'll deal with the far off prospect of renewed major weekly changes in Go if and when that arises.

Current status is compatible with Redis 2.4.n (2.4.9 tested) and Go 1. Redis feature set is not fully covered and is WIP.

(Always refer to compliance_note.txt for current (accurate) status for specific branches.)

Getting started:

Get, build, and startup Redis:

make
chmod +x redis-server
./redis-server redis.conf

Confirm:

alphazero[13]:entrevous$ telnet localhost 6379
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying fe80::1...
telnet: connect to address fe80::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.

PING
+PONG

INFO
$282
redis_version:1.07
arch_bits:32
uptime_in_seconds:72
uptime_in_days:0
connected_clients:1
connected_slaves:0
used_memory:295232
changes_since_last_save:1
bgsave_in_progress:0
last_save_time:1259873372
total_connections_received:4
total_commands_processed:5
role:master

QUIT
Connection closed by foreign host.
alphazero[14]:entrevous$ 

get, and install, Go-Redis

Go-Redis is built using the Go tool. The tool assumes the code will be in a folder $GOPATH/src/redis .

cd $GOPATH/src
git clone git://github.com/alphazero/Go-Redis.git redis
cd redis
go install

Confirm the install has created redis.a in your $GOPATH/pkg/ folder:

ls -l $GOPATH/pkg/"$GOOS"_"$GOARCH"/redis.a

e.g. on my Mac OS X (64b)

ls -l <my-gopath>/pkg/darwin_amd64

run the benchmarks

Basic benchmarks are in ~/bench. Use Go tool (go run ) to run the individual bench apps.

cd bench
# run the asyncbench.go 
go run asyncbench.go

examples

Ciao.go is a sort of hello world for redis and should get you started for the barebones necessities of getting a client and issuing commands.

cd examples
go run ciao.go
Something went wrong with that request. Please try again.