A Go implementation of the Redis server protocol
Go Makefile
Pull request Compare This branch is even with ralfonso:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
example
.gitignore
.travis.yml
AUTHORS
LICENSE
MAINTAINERS
Makefile
README.md
auto.go
auto_test.go
config.go
debug.go
defaultHandler.go
error.go
handler.go
handler_test.go
parser.go
parser_test.go
reply.go
reply_test.go
request.go
request_test.go
server.go
server_test.go
stack.go

README.md

Build Status

Redis server protocol library

There are plenty of good client implementations of the redis protocol, but not many server implementations.

go-redis-server is a helper library for building server software capable of speaking the redis protocol. This could be an alternate implementation of redis, a custom proxy to redis, or even a completely different backend capable of "masquerading" its API as a redis database.

Sample code

package main

import (
    redis "github.com/dotcloud/go-redis-server"
)

type MyHandler struct {
    values map[string][]byte
}

func (h *MyHandler) GET(key string) ([]byte, error) {
    v := h.values[key]
    return v, nil
}

func (h *MyHandler) SET(key string, value []byte) error {
    h.values[key] = value
    return nil
}

func main() {
    handler, _ := redis.NewAutoHandler(&MyHandler{values: make(map[string][]byte)})
    server := &redis.Server{Handler: handler, Addr: ":6389"}
    server.ListenAndServe()
}

Copyright (c) dotCloud 2013