Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: c138fcb089

Fetching latest commit…

Cannot retrieve the latest commit at this time

..
Failed to load latest commit information.
bench
example
misc
.gitignore
LICENSE
connection.go
format.go
format_test.go
godis.go
godis_test.go
parse.go
pool.go
pool_test.go
readme.md
reply.go

readme.md

exp-godis

godis/exp - an experimental Redis client for Go. It supports commands and features through a simple API which aims to be is easy to use.

  1. Package docs
  2. Source code

Install godis

godis/exp is available at github.com. Get it by running.

$ go get github.com/simonz05/godis/exp

Importing godis/exp will add a redis context to program.

Use exp-godis

A few examples are included. The following demonstrates SET and GET. See example/ for more.

package main

import (
    "github.com/simonz05/godis/exp"
)

func main() {
    c := redis.NewClient("tcp:127.0.0.1:6379")

    res, err := c.Call("SET", "foo", "bar")

    if err != nil {
        println(err.Error())
        return
    }

    res, _ = c.Call("GET", "foo")
    println("GET foo:", res.Elem.String())
}

Build and run the example.

$ make string; ./string

You should see the following printed in the terminal.

GET foo: bar 

In case your redis server isn't running, you'll get an error.

ERR 127.0.0.1:6379
Something went wrong with that request. Please try again.