Example #1
0
func TestRedis(t *testing.T) {
	if host == "" || port == "" {
		t.Skip("need redis host and port to test")
	}

	k, v := "greetings", "Hello World"

	r := redis.New(host, port)

	err := r.Put(k, []byte(v))

	if err != nil {
		t.Fatal(err.Error())
	}

	b := r.Get(k)

	if v != string(b) {
		t.Errorf("expected %s; got %s", v, b)
	}

	r.Flush()
}
Example #2
0
// Redis uses a Redis instance for storage.
func Redis(host, port string) Storage {
	return redis.New(host, port)
}