redismock

package module
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2019 License: MIT Imports: 3 Imported by: 0

README

redismock

Package github.com/elliotchance/redismock is useful for unit testing applications that interact with Redis. It uses the stretchr/testify mocking system.

Unlike using a real or fake Redis (more below), redismock provides normal and nice mocks for more flexibility in control behavior. One example might be to test the case where Redis takes too long to respond to a command, or returns an expected error.

NewMock()

Creates a hollow mock. You will need to stub all commands that you will interact with.

This is most useful when you want to strictly test all Redis interactions.

NewNiceMock(client)

Create a mocks that falls back to the real client in cases where a command has not been stubbed.

This is most useful when you want a real Redis instance, but you need to stub off certain commands or behaviors.

Compatibility

github.com/go-redis/redis

go-redis/redis is a real Redis client, and one of the most popular. It expects to connect to a real Redis server.

It provides a huge interface for all of the Redis commands called Cmdable. You should use Cmdable interface throughout your code, instead of the struct type.

github.com/alicebob/miniredis

miniredis creates a fake Redis server that can be used by go-redis/redis which makes it fantastic for running unit tests since you do not need to run a separate Redis server. It also only retains state with the instance, so each test gets an empty Redis database each time.

Example

import (
	"testing"
	"github.com/go-redis/redis"
	"github.com/alicebob/miniredis"
	"github.com/elliotchance/redismock"
	"errors"
	"github.com/stretchr/testify/assert"
)

// newTestRedis returns a redis.Cmdable.
func newTestRedis() *redismock.ClientMock {
	mr, err := miniredis.Run()
	if err != nil {
		panic(err)
	}

	client := redis.NewClient(&redis.Options{
		Addr: mr.Addr(),
	})

	return redismock.NewNiceMock(client)
}

// This would be your production code.
func RedisIsAvailable(client redis.Cmdable) bool {
	return client.Ping().Err() == nil
}

// Test Redis is down.
func TestRedisCannotBePinged(t *testing.T) {
	r := newTestRedis()
	r.On("Ping").
		Return(redis.NewStatusResult("", errors.New("server not available")))

	assert.False(t, RedisIsAvailable(r))
}

Documentation

Overview

Package redismock is useful for unit testing applications that interact with Redis.

The two constructors NewMock and NewNiceMock are explained in more detail on the functions themselves.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientMock

type ClientMock struct {
	mock.Mock
	// contains filtered or unexported fields
}

func NewMock

func NewMock() *ClientMock

NewMock creates a hollow mock. You will need to stub all commands that you will need to interact with.

This is most useful when you want to strictly test all Redis interactions. See NewNiceMock().

func NewNiceMock

func NewNiceMock(client *redis.Client) *ClientMock

NewNiceMock will create a mock that falls back to the real client in cases where a command has not been stubbed.

This is most useful when you want a real Redis instance, but you need to stub off certain commands or behaviors. See NewMock().

func (*ClientMock) Append

func (m *ClientMock) Append(key, value string) *redis.IntCmd

func (*ClientMock) BLPop

func (m *ClientMock) BLPop(timeout time.Duration, keys ...string) *redis.StringSliceCmd

func (*ClientMock) BRPop

func (m *ClientMock) BRPop(timeout time.Duration, keys ...string) *redis.StringSliceCmd

func (*ClientMock) BRPopLPush

func (m *ClientMock) BRPopLPush(source, destination string, timeout time.Duration) *redis.StringCmd

func (*ClientMock) BZPopMax added in v1.3.0

func (m *ClientMock) BZPopMax(timeout time.Duration, keys ...string) *redis.ZWithKeyCmd

func (*ClientMock) BZPopMin added in v1.3.0

func (m *ClientMock) BZPopMin(timeout time.Duration, keys ...string) *redis.ZWithKeyCmd

func (*ClientMock) BgRewriteAOF

func (m *ClientMock) BgRewriteAOF() *redis.StatusCmd

func (*ClientMock) BgSave

func (m *ClientMock) BgSave() *redis.StatusCmd

func (*ClientMock) BitCount

func (m *ClientMock) BitCount(key string, bitCount *redis.BitCount) *redis.IntCmd

func (*ClientMock) BitOpAnd

func (m *ClientMock) BitOpAnd(destKey string, keys ...string) *redis.IntCmd

func (*ClientMock) BitOpNot

func (m *ClientMock) BitOpNot(destKey string, key string) *redis.IntCmd

func (*ClientMock) BitOpOr

func (m *ClientMock) BitOpOr(destKey string, keys ...string) *redis.IntCmd

func (*ClientMock) BitOpXor

func (m *ClientMock) BitOpXor(destKey string, keys ...string) *redis.IntCmd

func (*ClientMock) BitPos

func (m *ClientMock) BitPos(key string, bit int64, pos ...int64) *redis.IntCmd

func (*ClientMock) ClientGetName

func (m *ClientMock) ClientGetName() *redis.StringCmd

func (*ClientMock) ClientID added in v1.4.0

func (m *ClientMock) ClientID() *redis.IntCmd

func (*ClientMock) ClientKill

func (m *ClientMock) ClientKill(ipPort string) *redis.StatusCmd

func (*ClientMock) ClientKillByFilter added in v1.1.0

func (m *ClientMock) ClientKillByFilter(keys ...string) *redis.IntCmd

func (*ClientMock) ClientList

func (m *ClientMock) ClientList() *redis.StringCmd

func (*ClientMock) ClientPause

func (m *ClientMock) ClientPause(dur time.Duration) *redis.BoolCmd

func (*ClientMock) ClusterAddSlots

func (m *ClientMock) ClusterAddSlots(slots ...int) *redis.StatusCmd

func (*ClientMock) ClusterAddSlotsRange

func (m *ClientMock) ClusterAddSlotsRange(min, max int) *redis.StatusCmd

func (*ClientMock) ClusterCountFailureReports

func (m *ClientMock) ClusterCountFailureReports(nodeID string) *redis.IntCmd

func (*ClientMock) ClusterCountKeysInSlot

func (m *ClientMock) ClusterCountKeysInSlot(slot int) *redis.IntCmd

func (*ClientMock) ClusterDelSlots

func (m *ClientMock) ClusterDelSlots(slots ...int) *redis.StatusCmd

func (*ClientMock) ClusterDelSlotsRange

func (m *ClientMock) ClusterDelSlotsRange(min, max int) *redis.StatusCmd

func (*ClientMock) ClusterFailover

func (m *ClientMock) ClusterFailover() *redis.StatusCmd

func (*ClientMock) ClusterForget

func (m *ClientMock) ClusterForget(nodeID string) *redis.StatusCmd

func (*ClientMock) ClusterGetKeysInSlot added in v1.5.0

func (m *ClientMock) ClusterGetKeysInSlot(slot int, count int) *redis.StringSliceCmd

func (*ClientMock) ClusterInfo

func (m *ClientMock) ClusterInfo() *redis.StringCmd

func (*ClientMock) ClusterKeySlot

func (m *ClientMock) ClusterKeySlot(key string) *redis.IntCmd

func (*ClientMock) ClusterMeet

func (m *ClientMock) ClusterMeet(host, port string) *redis.StatusCmd

func (*ClientMock) ClusterNodes

func (m *ClientMock) ClusterNodes() *redis.StringCmd

func (*ClientMock) ClusterReplicate

func (m *ClientMock) ClusterReplicate(nodeID string) *redis.StatusCmd

func (*ClientMock) ClusterResetHard

func (m *ClientMock) ClusterResetHard() *redis.StatusCmd

func (*ClientMock) ClusterResetSoft

func (m *ClientMock) ClusterResetSoft() *redis.StatusCmd

func (*ClientMock) ClusterSaveConfig

func (m *ClientMock) ClusterSaveConfig() *redis.StatusCmd

func (*ClientMock) ClusterSlaves

func (m *ClientMock) ClusterSlaves(nodeID string) *redis.StringSliceCmd

func (*ClientMock) ClusterSlots

func (m *ClientMock) ClusterSlots() *redis.ClusterSlotsCmd

func (*ClientMock) Command

func (m *ClientMock) Command() *redis.CommandsInfoCmd

func (*ClientMock) ConfigGet

func (m *ClientMock) ConfigGet(parameter string) *redis.SliceCmd

func (*ClientMock) ConfigResetStat

func (m *ClientMock) ConfigResetStat() *redis.StatusCmd

func (*ClientMock) ConfigRewrite

func (m *ClientMock) ConfigRewrite() *redis.StatusCmd

func (*ClientMock) ConfigSet

func (m *ClientMock) ConfigSet(parameter, value string) *redis.StatusCmd

func (*ClientMock) DBSize

func (m *ClientMock) DBSize() *redis.IntCmd

func (*ClientMock) DebugObject

func (m *ClientMock) DebugObject(key string) *redis.StringCmd

func (*ClientMock) Decr

func (m *ClientMock) Decr(key string) *redis.IntCmd

func (*ClientMock) DecrBy

func (m *ClientMock) DecrBy(key string, decrement int64) *redis.IntCmd

func (*ClientMock) Del

func (m *ClientMock) Del(keys ...string) *redis.IntCmd

func (*ClientMock) Dump

func (m *ClientMock) Dump(key string) *redis.StringCmd

func (*ClientMock) Echo

func (m *ClientMock) Echo(message interface{}) *redis.StringCmd

func (*ClientMock) Eval

func (m *ClientMock) Eval(script string, keys []string, args ...interface{}) *redis.Cmd

func (*ClientMock) EvalSha

func (m *ClientMock) EvalSha(sha1 string, keys []string, args ...interface{}) *redis.Cmd

func (*ClientMock) Exists

func (m *ClientMock) Exists(keys ...string) *redis.IntCmd

func (*ClientMock) Expire

func (m *ClientMock) Expire(key string, expiration time.Duration) *redis.BoolCmd

func (*ClientMock) ExpireAt

func (m *ClientMock) ExpireAt(key string, tm time.Time) *redis.BoolCmd

func (*ClientMock) FlushAll

func (m *ClientMock) FlushAll() *redis.StatusCmd

func (*ClientMock) FlushAllAsync

func (m *ClientMock) FlushAllAsync() *redis.StatusCmd

func (*ClientMock) FlushDB

func (m *ClientMock) FlushDB() *redis.StatusCmd

func (*ClientMock) FlushDBAsync

func (m *ClientMock) FlushDBAsync() *redis.StatusCmd

func (*ClientMock) GeoAdd

func (m *ClientMock) GeoAdd(key string, geoLocation ...*redis.GeoLocation) *redis.IntCmd

func (*ClientMock) GeoDist

func (m *ClientMock) GeoDist(key string, member1, member2, unit string) *redis.FloatCmd

func (*ClientMock) GeoHash

func (m *ClientMock) GeoHash(key string, members ...string) *redis.StringSliceCmd

func (*ClientMock) GeoPos

func (m *ClientMock) GeoPos(key string, members ...string) *redis.GeoPosCmd

func (*ClientMock) GeoRadius

func (m *ClientMock) GeoRadius(key string, longitude, latitude float64, query *redis.GeoRadiusQuery) *redis.GeoLocationCmd

func (*ClientMock) GeoRadiusByMember

func (m *ClientMock) GeoRadiusByMember(key, member string, query *redis.GeoRadiusQuery) *redis.GeoLocationCmd

func (*ClientMock) GeoRadiusByMemberRO

func (m *ClientMock) GeoRadiusByMemberRO(key, member string, query *redis.GeoRadiusQuery) *redis.GeoLocationCmd

func (*ClientMock) GeoRadiusRO

func (m *ClientMock) GeoRadiusRO(key string, longitude, latitude float64, query *redis.GeoRadiusQuery) *redis.GeoLocationCmd

func (*ClientMock) Get

func (m *ClientMock) Get(key string) *redis.StringCmd

func (*ClientMock) GetBit

func (m *ClientMock) GetBit(key string, offset int64) *redis.IntCmd

func (*ClientMock) GetRange

func (m *ClientMock) GetRange(key string, start, end int64) *redis.StringCmd

func (*ClientMock) GetSet

func (m *ClientMock) GetSet(key string, value interface{}) *redis.StringCmd

func (*ClientMock) HDel

func (m *ClientMock) HDel(key string, fields ...string) *redis.IntCmd

func (*ClientMock) HExists

func (m *ClientMock) HExists(key, field string) *redis.BoolCmd

func (*ClientMock) HGet

func (m *ClientMock) HGet(key, field string) *redis.StringCmd

func (*ClientMock) HGetAll

func (m *ClientMock) HGetAll(key string) *redis.StringStringMapCmd

func (*ClientMock) HIncrBy

func (m *ClientMock) HIncrBy(key, field string, incr int64) *redis.IntCmd

func (*ClientMock) HIncrByFloat

func (m *ClientMock) HIncrByFloat(key, field string, incr float64) *redis.FloatCmd

func (*ClientMock) HKeys

func (m *ClientMock) HKeys(key string) *redis.StringSliceCmd

func (*ClientMock) HLen

func (m *ClientMock) HLen(key string) *redis.IntCmd

func (*ClientMock) HMGet

func (m *ClientMock) HMGet(key string, fields ...string) *redis.SliceCmd

func (*ClientMock) HMSet

func (m *ClientMock) HMSet(key string, fields map[string]interface{}) *redis.StatusCmd

func (*ClientMock) HScan

func (m *ClientMock) HScan(key string, cursor uint64, match string, count int64) *redis.ScanCmd

func (*ClientMock) HSet

func (m *ClientMock) HSet(key, field string, value interface{}) *redis.BoolCmd

func (*ClientMock) HSetNX

func (m *ClientMock) HSetNX(key, field string, value interface{}) *redis.BoolCmd

func (*ClientMock) HVals

func (m *ClientMock) HVals(key string) *redis.StringSliceCmd

func (*ClientMock) Incr

func (m *ClientMock) Incr(key string) *redis.IntCmd

func (*ClientMock) IncrBy

func (m *ClientMock) IncrBy(key string, value int64) *redis.IntCmd

func (*ClientMock) IncrByFloat

func (m *ClientMock) IncrByFloat(key string, value float64) *redis.FloatCmd

func (*ClientMock) Info

func (m *ClientMock) Info(section ...string) *redis.StringCmd

func (*ClientMock) Keys

func (m *ClientMock) Keys(pattern string) *redis.StringSliceCmd

func (*ClientMock) LIndex

func (m *ClientMock) LIndex(key string, index int64) *redis.StringCmd

func (*ClientMock) LInsert

func (m *ClientMock) LInsert(key, op string, pivot, value interface{}) *redis.IntCmd

func (*ClientMock) LInsertAfter

func (m *ClientMock) LInsertAfter(key string, pivot, value interface{}) *redis.IntCmd

func (*ClientMock) LInsertBefore

func (m *ClientMock) LInsertBefore(key string, pivot, value interface{}) *redis.IntCmd

func (*ClientMock) LLen

func (m *ClientMock) LLen(key string) *redis.IntCmd

func (*ClientMock) LPop

func (m *ClientMock) LPop(key string) *redis.StringCmd

func (*ClientMock) LPush

func (m *ClientMock) LPush(key string, values ...interface{}) *redis.IntCmd

func (*ClientMock) LPushX

func (m *ClientMock) LPushX(key string, value interface{}) *redis.IntCmd

func (*ClientMock) LRange

func (m *ClientMock) LRange(key string, start, stop int64) *redis.StringSliceCmd

func (*ClientMock) LRem

func (m *ClientMock) LRem(key string, count int64, value interface{}) *redis.IntCmd

func (*ClientMock) LSet

func (m *ClientMock) LSet(key string, index int64, value interface{}) *redis.StatusCmd

func (*ClientMock) LTrim

func (m *ClientMock) LTrim(key string, start, stop int64) *redis.StatusCmd

func (*ClientMock) LastSave

func (m *ClientMock) LastSave() *redis.IntCmd

func (*ClientMock) MGet

func (m *ClientMock) MGet(keys ...string) *redis.SliceCmd

func (*ClientMock) MSet

func (m *ClientMock) MSet(pairs ...interface{}) *redis.StatusCmd

func (*ClientMock) MSetNX

func (m *ClientMock) MSetNX(pairs ...interface{}) *redis.BoolCmd

func (*ClientMock) MemoryUsage added in v1.1.0

func (m *ClientMock) MemoryUsage(key string, samples ...int) *redis.IntCmd

func (*ClientMock) Migrate

func (m *ClientMock) Migrate(host, port, key string, db int64, timeout time.Duration) *redis.StatusCmd

func (*ClientMock) Move

func (m *ClientMock) Move(key string, db int64) *redis.BoolCmd

func (*ClientMock) ObjectEncoding

func (m *ClientMock) ObjectEncoding(key string) *redis.StringCmd

func (*ClientMock) ObjectIdleTime

func (m *ClientMock) ObjectIdleTime(key string) *redis.DurationCmd

func (*ClientMock) ObjectRefCount

func (m *ClientMock) ObjectRefCount(key string) *redis.IntCmd

func (*ClientMock) PExpire

func (m *ClientMock) PExpire(key string, expiration time.Duration) *redis.BoolCmd

func (*ClientMock) PExpireAt

func (m *ClientMock) PExpireAt(key string, tm time.Time) *redis.BoolCmd

func (*ClientMock) PFAdd

func (m *ClientMock) PFAdd(key string, els ...interface{}) *redis.IntCmd

func (*ClientMock) PFCount

func (m *ClientMock) PFCount(keys ...string) *redis.IntCmd

func (*ClientMock) PFMerge

func (m *ClientMock) PFMerge(dest string, keys ...string) *redis.StatusCmd

func (*ClientMock) PTTL

func (m *ClientMock) PTTL(key string) *redis.DurationCmd

func (*ClientMock) Persist

func (m *ClientMock) Persist(key string) *redis.BoolCmd

func (*ClientMock) Ping

func (m *ClientMock) Ping() *redis.StatusCmd

func (*ClientMock) Pipeline

func (m *ClientMock) Pipeline() redis.Pipeliner

func (*ClientMock) Pipelined

func (m *ClientMock) Pipelined(fn func(redis.Pipeliner) error) ([]redis.Cmder, error)

func (*ClientMock) PubSubChannels

func (m *ClientMock) PubSubChannels(pattern string) *redis.StringSliceCmd

func (*ClientMock) PubSubNumPat

func (m *ClientMock) PubSubNumPat() *redis.IntCmd

func (*ClientMock) PubSubNumSub

func (m *ClientMock) PubSubNumSub(channels ...string) *redis.StringIntMapCmd

func (*ClientMock) Publish

func (m *ClientMock) Publish(channel string, message interface{}) *redis.IntCmd

func (*ClientMock) Quit

func (m *ClientMock) Quit() *redis.StatusCmd

func (*ClientMock) RPop

func (m *ClientMock) RPop(key string) *redis.StringCmd

func (*ClientMock) RPopLPush

func (m *ClientMock) RPopLPush(source, destination string) *redis.StringCmd

func (*ClientMock) RPush

func (m *ClientMock) RPush(key string, values ...interface{}) *redis.IntCmd

func (*ClientMock) RPushX

func (m *ClientMock) RPushX(key string, value interface{}) *redis.IntCmd

func (*ClientMock) RandomKey

func (m *ClientMock) RandomKey() *redis.StringCmd

func (*ClientMock) ReadOnly added in v1.1.0

func (m *ClientMock) ReadOnly() *redis.StatusCmd

func (*ClientMock) ReadWrite added in v1.1.0

func (m *ClientMock) ReadWrite() *redis.StatusCmd

func (*ClientMock) Rename

func (m *ClientMock) Rename(key, newkey string) *redis.StatusCmd

func (*ClientMock) RenameNX

func (m *ClientMock) RenameNX(key, newkey string) *redis.BoolCmd

func (*ClientMock) Restore

func (m *ClientMock) Restore(key string, ttl time.Duration, value string) *redis.StatusCmd

func (*ClientMock) RestoreReplace

func (m *ClientMock) RestoreReplace(key string, ttl time.Duration, value string) *redis.StatusCmd

func (*ClientMock) SAdd

func (m *ClientMock) SAdd(key string, members ...interface{}) *redis.IntCmd

func (*ClientMock) SCard

func (m *ClientMock) SCard(key string) *redis.IntCmd

func (*ClientMock) SDiff

func (m *ClientMock) SDiff(keys ...string) *redis.StringSliceCmd

func (*ClientMock) SDiffStore

func (m *ClientMock) SDiffStore(destination string, keys ...string) *redis.IntCmd

func (*ClientMock) SInter

func (m *ClientMock) SInter(keys ...string) *redis.StringSliceCmd

func (*ClientMock) SInterStore

func (m *ClientMock) SInterStore(destination string, keys ...string) *redis.IntCmd

func (*ClientMock) SIsMember

func (m *ClientMock) SIsMember(key string, member interface{}) *redis.BoolCmd

func (*ClientMock) SMembers

func (m *ClientMock) SMembers(key string) *redis.StringSliceCmd

func (*ClientMock) SMembersMap

func (m *ClientMock) SMembersMap(key string) *redis.StringStructMapCmd

func (*ClientMock) SMove

func (m *ClientMock) SMove(source, destination string, member interface{}) *redis.BoolCmd

func (*ClientMock) SPop

func (m *ClientMock) SPop(key string) *redis.StringCmd

func (*ClientMock) SPopN

func (m *ClientMock) SPopN(key string, count int64) *redis.StringSliceCmd

func (*ClientMock) SRandMember

func (m *ClientMock) SRandMember(key string) *redis.StringCmd

func (*ClientMock) SRandMemberN

func (m *ClientMock) SRandMemberN(key string, count int64) *redis.StringSliceCmd

func (*ClientMock) SRem

func (m *ClientMock) SRem(key string, members ...interface{}) *redis.IntCmd

func (*ClientMock) SScan

func (m *ClientMock) SScan(key string, cursor uint64, match string, count int64) *redis.ScanCmd

func (*ClientMock) SUnion

func (m *ClientMock) SUnion(keys ...string) *redis.StringSliceCmd

func (*ClientMock) SUnionStore

func (m *ClientMock) SUnionStore(destination string, keys ...string) *redis.IntCmd

func (*ClientMock) Save

func (m *ClientMock) Save() *redis.StatusCmd

func (*ClientMock) Scan

func (m *ClientMock) Scan(cursor uint64, match string, count int64) *redis.ScanCmd

func (*ClientMock) ScriptExists

func (m *ClientMock) ScriptExists(hashes ...string) *redis.BoolSliceCmd

func (*ClientMock) ScriptFlush

func (m *ClientMock) ScriptFlush() *redis.StatusCmd

func (*ClientMock) ScriptKill

func (m *ClientMock) ScriptKill() *redis.StatusCmd

func (*ClientMock) ScriptLoad

func (m *ClientMock) ScriptLoad(script string) *redis.StringCmd

func (*ClientMock) Set

func (m *ClientMock) Set(key string, value interface{}, expiration time.Duration) *redis.StatusCmd

func (*ClientMock) SetBit

func (m *ClientMock) SetBit(key string, offset int64, value int) *redis.IntCmd

func (*ClientMock) SetNX

func (m *ClientMock) SetNX(key string, value interface{}, expiration time.Duration) *redis.BoolCmd

func (*ClientMock) SetRange

func (m *ClientMock) SetRange(key string, offset int64, value string) *redis.IntCmd

func (*ClientMock) SetXX

func (m *ClientMock) SetXX(key string, value interface{}, expiration time.Duration) *redis.BoolCmd

func (*ClientMock) Shutdown

func (m *ClientMock) Shutdown() *redis.StatusCmd

func (*ClientMock) ShutdownNoSave

func (m *ClientMock) ShutdownNoSave() *redis.StatusCmd

func (*ClientMock) ShutdownSave

func (m *ClientMock) ShutdownSave() *redis.StatusCmd

func (*ClientMock) SlaveOf

func (m *ClientMock) SlaveOf(host, port string) *redis.StatusCmd

func (*ClientMock) Sort

func (m *ClientMock) Sort(key string, sort *redis.Sort) *redis.StringSliceCmd

func (*ClientMock) SortInterfaces

func (m *ClientMock) SortInterfaces(key string, sort *redis.Sort) *redis.SliceCmd

func (*ClientMock) SortStore

func (m *ClientMock) SortStore(key, store string, sort *redis.Sort) *redis.IntCmd

func (*ClientMock) StrLen

func (m *ClientMock) StrLen(key string) *redis.IntCmd

func (*ClientMock) TTL

func (m *ClientMock) TTL(key string) *redis.DurationCmd

func (*ClientMock) Time

func (m *ClientMock) Time() *redis.TimeCmd

func (*ClientMock) Touch

func (m *ClientMock) Touch(keys ...string) *redis.IntCmd

func (*ClientMock) TxPipeline

func (m *ClientMock) TxPipeline() redis.Pipeliner

func (*ClientMock) TxPipelined

func (m *ClientMock) TxPipelined(fn func(redis.Pipeliner) error) ([]redis.Cmder, error)

func (*ClientMock) Type

func (m *ClientMock) Type(key string) *redis.StatusCmd
func (m *ClientMock) Unlink(keys ...string) *redis.IntCmd

func (*ClientMock) Watch

func (m *ClientMock) Watch(fn func(*redis.Tx) error, keys ...string) error

func (*ClientMock) XAck added in v1.2.0

func (m *ClientMock) XAck(stream, group string, ids ...string) *redis.IntCmd

func (*ClientMock) XAdd added in v1.1.0

func (m *ClientMock) XAdd(a *redis.XAddArgs) *redis.StringCmd

func (*ClientMock) XClaim added in v1.2.0

func (*ClientMock) XClaimJustID added in v1.2.0

func (m *ClientMock) XClaimJustID(a *redis.XClaimArgs) *redis.StringSliceCmd

func (*ClientMock) XDel added in v1.3.0

func (m *ClientMock) XDel(stream string, ids ...string) *redis.IntCmd

func (*ClientMock) XGroupCreate added in v1.2.0

func (m *ClientMock) XGroupCreate(stream, group, start string) *redis.StatusCmd

func (*ClientMock) XGroupCreateMkStream added in v1.4.0

func (m *ClientMock) XGroupCreateMkStream(stream, group, start string) *redis.StatusCmd

func (*ClientMock) XGroupDelConsumer added in v1.2.0

func (m *ClientMock) XGroupDelConsumer(stream, group, consumer string) *redis.IntCmd

func (*ClientMock) XGroupDestroy added in v1.2.0

func (m *ClientMock) XGroupDestroy(stream, group string) *redis.IntCmd

func (*ClientMock) XGroupSetID added in v1.2.0

func (m *ClientMock) XGroupSetID(stream, group, start string) *redis.StatusCmd

func (*ClientMock) XLen added in v1.1.0

func (m *ClientMock) XLen(stream string) *redis.IntCmd

func (*ClientMock) XPending added in v1.2.0

func (m *ClientMock) XPending(stream, group string) *redis.XPendingCmd

func (*ClientMock) XPendingExt added in v1.2.0

func (m *ClientMock) XPendingExt(a *redis.XPendingExtArgs) *redis.XPendingExtCmd

func (*ClientMock) XRange added in v1.1.0

func (m *ClientMock) XRange(stream, start, stop string) *redis.XMessageSliceCmd

func (*ClientMock) XRangeN added in v1.1.0

func (m *ClientMock) XRangeN(stream, start, stop string, count int64) *redis.XMessageSliceCmd

func (*ClientMock) XRead added in v1.1.0

func (*ClientMock) XReadGroup added in v1.2.0

func (*ClientMock) XReadStreams added in v1.2.0

func (m *ClientMock) XReadStreams(streams ...string) *redis.XStreamSliceCmd

func (*ClientMock) XRevRange added in v1.1.0

func (m *ClientMock) XRevRange(stream string, start, stop string) *redis.XMessageSliceCmd

func (*ClientMock) XRevRangeN added in v1.1.0

func (m *ClientMock) XRevRangeN(stream string, start, stop string, count int64) *redis.XMessageSliceCmd

func (*ClientMock) XTrim added in v1.2.0

func (m *ClientMock) XTrim(key string, maxLen int64) *redis.IntCmd

func (*ClientMock) XTrimApprox added in v1.2.0

func (m *ClientMock) XTrimApprox(key string, maxLen int64) *redis.IntCmd

func (*ClientMock) ZAdd

func (m *ClientMock) ZAdd(key string, members ...redis.Z) *redis.IntCmd

func (*ClientMock) ZAddCh

func (m *ClientMock) ZAddCh(key string, members ...redis.Z) *redis.IntCmd

func (*ClientMock) ZAddNX

func (m *ClientMock) ZAddNX(key string, members ...redis.Z) *redis.IntCmd

func (*ClientMock) ZAddNXCh

func (m *ClientMock) ZAddNXCh(key string, members ...redis.Z) *redis.IntCmd

func (*ClientMock) ZAddXX

func (m *ClientMock) ZAddXX(key string, members ...redis.Z) *redis.IntCmd

func (*ClientMock) ZAddXXCh

func (m *ClientMock) ZAddXXCh(key string, members ...redis.Z) *redis.IntCmd

func (*ClientMock) ZCard

func (m *ClientMock) ZCard(key string) *redis.IntCmd

func (*ClientMock) ZCount

func (m *ClientMock) ZCount(key, min, max string) *redis.IntCmd

func (*ClientMock) ZIncr

func (m *ClientMock) ZIncr(key string, member redis.Z) *redis.FloatCmd

func (*ClientMock) ZIncrBy

func (m *ClientMock) ZIncrBy(key string, increment float64, member string) *redis.FloatCmd

func (*ClientMock) ZIncrNX

func (m *ClientMock) ZIncrNX(key string, member redis.Z) *redis.FloatCmd

func (*ClientMock) ZIncrXX

func (m *ClientMock) ZIncrXX(key string, member redis.Z) *redis.FloatCmd

func (*ClientMock) ZInterStore

func (m *ClientMock) ZInterStore(destination string, store redis.ZStore, keys ...string) *redis.IntCmd

func (*ClientMock) ZLexCount

func (m *ClientMock) ZLexCount(key, min, max string) *redis.IntCmd

func (*ClientMock) ZPopMax added in v1.2.0

func (m *ClientMock) ZPopMax(key string, count ...int64) *redis.ZSliceCmd

func (*ClientMock) ZPopMin added in v1.2.0

func (m *ClientMock) ZPopMin(key string, count ...int64) *redis.ZSliceCmd

func (*ClientMock) ZRange

func (m *ClientMock) ZRange(key string, start, stop int64) *redis.StringSliceCmd

func (*ClientMock) ZRangeByLex

func (m *ClientMock) ZRangeByLex(key string, opt redis.ZRangeBy) *redis.StringSliceCmd

func (*ClientMock) ZRangeByScore

func (m *ClientMock) ZRangeByScore(key string, opt redis.ZRangeBy) *redis.StringSliceCmd

func (*ClientMock) ZRangeByScoreWithScores

func (m *ClientMock) ZRangeByScoreWithScores(key string, opt redis.ZRangeBy) *redis.ZSliceCmd

func (*ClientMock) ZRangeWithScores

func (m *ClientMock) ZRangeWithScores(key string, start, stop int64) *redis.ZSliceCmd

func (*ClientMock) ZRank

func (m *ClientMock) ZRank(key, member string) *redis.IntCmd

func (*ClientMock) ZRem

func (m *ClientMock) ZRem(key string, members ...interface{}) *redis.IntCmd

func (*ClientMock) ZRemRangeByLex

func (m *ClientMock) ZRemRangeByLex(key, min, max string) *redis.IntCmd

func (*ClientMock) ZRemRangeByRank

func (m *ClientMock) ZRemRangeByRank(key string, start, stop int64) *redis.IntCmd

func (*ClientMock) ZRemRangeByScore

func (m *ClientMock) ZRemRangeByScore(key, min, max string) *redis.IntCmd

func (*ClientMock) ZRevRange

func (m *ClientMock) ZRevRange(key string, start, stop int64) *redis.StringSliceCmd

func (*ClientMock) ZRevRangeByLex

func (m *ClientMock) ZRevRangeByLex(key string, opt redis.ZRangeBy) *redis.StringSliceCmd

func (*ClientMock) ZRevRangeByScore

func (m *ClientMock) ZRevRangeByScore(key string, opt redis.ZRangeBy) *redis.StringSliceCmd

func (*ClientMock) ZRevRangeByScoreWithScores

func (m *ClientMock) ZRevRangeByScoreWithScores(key string, opt redis.ZRangeBy) *redis.ZSliceCmd

func (*ClientMock) ZRevRangeWithScores

func (m *ClientMock) ZRevRangeWithScores(key string, start, stop int64) *redis.ZSliceCmd

func (*ClientMock) ZRevRank

func (m *ClientMock) ZRevRank(key, member string) *redis.IntCmd

func (*ClientMock) ZScan

func (m *ClientMock) ZScan(key string, cursor uint64, match string, count int64) *redis.ScanCmd

func (*ClientMock) ZScore

func (m *ClientMock) ZScore(key, member string) *redis.FloatCmd

func (*ClientMock) ZUnionStore

func (m *ClientMock) ZUnionStore(dest string, store redis.ZStore, keys ...string) *redis.IntCmd

Jump to

Keyboard shortcuts

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