Package list golang-github-stvp-tempredis / dbec5255-84a6-4ada-9e56-bcc63b5d2d8c/main example_test.go
dbec5255-84a6-4ada-9e56-bcc63b5d2d8c/main

Tree @dbec5255-84a6-4ada-9e56-bcc63b5d2d8c/main (Download .tar.gz)

example_test.go @dbec5255-84a6-4ada-9e56-bcc63b5d2d8c/mainraw · history · blame

package tempredis

import (
	"github.com/garyburd/redigo/redis"
)

func ExampleUsage() {
	server, err := Start(Config{"databases": "8"})
	if err != nil {
		panic(err)
	}
	defer server.Term()

	conn, err := redis.Dial("unix", server.Socket())
	defer conn.Close()
	if err != nil {
		panic(err)
	}

	conn.Do("SET", "foo", "bar")
}