File: example_test.go

package info (click to toggle)
golang-github-stvp-tempredis 0.0~git20160122.0.83f7aae-2.1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, sid
  • size: 80 kB
  • sloc: makefile: 2
file content (21 lines) | stat: -rw-r--r-- 328 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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")
}