redis

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2022 License: MIT Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mocker

type Mocker interface {
	Rediser
	QueriesRun() []onedb.MethodsRun
	SaveMethodCall(name string, arguments []interface{})
	VerifyNextCommand(t *testing.T, name string, expected ...interface{})
}

Mocker interface includes all the Rediser interface, plus three additional methods to help with testing

func NewMock

func NewMock(delErr, saveErr error, doResult interface{}, doErr error) Mocker

NewMock is the constructor for a fake Redis connection

type Rediser

type Rediser interface {
	Close() error
	Del(key string) error
	Do(command string, args ...interface{}) (interface{}, error)
	Get(key string) (string, error)
	GetStruct(key string, result interface{}) error
	SetWithExpire(key string, value interface{}, expireSeconds int) error
}

Rediser is the public interface for querying Redis

func New

func New(server string, port int, password string, maxIdle, maxConnections int) Rediser

New is the constructor for a Redis connection

Jump to

Keyboard shortcuts

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