redistest

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 13, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TestArgs

func TestArgs(t *testing.T, makeArgs MakeArgs)

TestArgs is a test suite which verifies the behavior of Args implementations.

func TestClient

func TestClient(t *testing.T, makeClient MakeClient)

TestClient is a test suite which verifies the behavior of redis clients.

func TestServerRegistry

func TestServerRegistry(t *testing.T, makeServerRegistry MakeServerRegistry)

TestServerRegistry is a test suite which verifies the behavior of ServerRegistry implementations.

Types

type Client

type Client interface {
	Exec(context.Context, string, ...interface{}) error
	Query(context.Context, string, ...interface{}) redis.Args
	Subscribe(context.Context, ...string) (*redis.SubConn, error)
	PSubscribe(context.Context, ...string) (*redis.SubConn, error)
}

Client is an interface that must be implemented by types that represent redis clients and wish to be tested using the TestClient test suite.

type MakeArgs

type MakeArgs func(...interface{}) (redis.Args, func(), error)

MakeArgs is the type of factory functions that the TestArgs test suite uses to create Args to run the tests against.

type MakeClient

type MakeClient func() (client Client, close func(), err error)

MakeClient is the type of factory functions that the TestClient test suite uses to create Clients to run the tests against.

type MakeServerRegistry

type MakeServerRegistry func() (redis.ServerRegistry, []redis.ServerEndpoint, func(), error)

MakeServerRegistry is the type of factory functions that the TestServerRegistry test suite uses to create Clients to run the tests against.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL