Package list golang-github-stvp-tempredis / b9ce4e67-38d3-45d2-9c1c-409d65014d4d/main example_test.go
b9ce4e67-38d3-45d2-9c1c-409d65014d4d/main

Tree @b9ce4e67-38d3-45d2-9c1c-409d65014d4d/main (Download .tar.gz)

example_test.go @b9ce4e67-38d3-45d2-9c1c-409d65014d4d/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")
}