Redcon – Fast Redis server implementation for Go

README.md

Fast Redis compatible server framework for Go

Redcon is a custom Redis server framework for Go that is fast and simple to use. The reason for this library it to give an efficient server front-end for the BuntDB and Tile38 projects.

Features

Create a Fast custom Redis compatible server in Go
Simple interface. One function ListenAndServe and one type Conn
Support for pipelining and telnet commands
Works with Redis clients such as redigo, redis-py, node_redis, and jedis
Installing

go get -u github.com/tidwall/redcon

Example

Here’s a full example of a Redis clone that accepts:

SET key value
GET key
DEL key
PING
QUIT
You can run this example from a terminal:

package main

import (
“log”
“strings”
“sync”

“github.com/tidwall/redcon”
)

var addr = “:6380”

func main() {
var mu sync.RWMutex
var items = make(map[string]string)
go log.Printf(“started server at %s”, addr)
err := redcon.ListenAndServe(addr,
func(conn redcon.Conn, commands [][]string) {
for _, args := range commands {
switch strings.ToLower(args[0]) {
default:
conn.WriteError(“ERR unknown command ‘” + args[0] + “‘”)
case


Original URL: http://feedproxy.google.com/~r/feedsapi/BwPx/~3/5P0CDdkZDD4/redcon

Original article

Comments are closed.

Proudly powered by WordPress | Theme: Baskerville 2 by Anders Noren.

Up ↑

%d bloggers like this: