Documentation ¶
Overview ¶
Package redis defines the standard interface for a redis database. It aims for a small api surface, and given the extensibility capabilies of redis, allows for arbitrary commands to be executed. As such, it is closer to the redigo Go package's interface, other client packages may require an adapter.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Conn ¶
type Conn interface { // Close releases the resources used by the connection. Close() error // Do executes an arbitrary command with the provided arguments. Do(ctx context.Context, commandName string, args ...interface{}) (reply interface{}, err error) // Send queues a command to be executed, but does not execute the roundtrip // yet. A subsequent call to Do (either with the last command // in the pipeline or with an empty command) executes the pipeline. Send(ctx context.Context, commandName string, args ...interface{}) error }
Conn defines the methods required for a Redis connection.
type MockConn ¶
type MockConn struct { CloseFunc func() error DoFunc func(context.Context, string, ...interface{}) (interface{}, error) SendFunc func(context.Context, string, ...interface{}) error }
MockConn is a test mock for the Conn interface.
type Pool ¶
type Pool interface { // Get returns a connection from the pool. The context is applied to the // connection attempt by the pool. Any expiration on the context will not // affect the returned connection - the connection itself should be managed // via timeouts. Get(ctx context.Context) Conn // Close closes the pool and any resources associated with it. Close() error }
Pool defines the methods required for a Redis pool.
Click to show internal directories.
Click to hide internal directories.