mocks

package
v5.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockClient

type MockClient struct {
	ClusterModeCall            func() bool
	ClusterCountKeysInSlotCall func(slot int) redis.Result
	ClusterSlotForKeyCall      func(key string) redis.Result
	ClusterKeysInSlotCall      func(slot int, count int) redis.Result
	DelCall                    func(keys ...string) redis.Result
	GetCall                    func(key string) redis.Result
	SetCall                    func(key string, value interface{}, expiration time.Duration) redis.Result
	PingCall                   func() redis.Result
	ExistsCall                 func(keys ...string) redis.Result
	KeysCall                   func(pattern string) redis.Result
	SMembersCall               func(key string) redis.Result
	SIsMemberCall              func(key string, member interface{}) redis.Result
	SAddCall                   func(key string, members ...interface{}) redis.Result
	SRemCall                   func(key string, members ...interface{}) redis.Result
	IncrCall                   func(key string) redis.Result
	DecrCall                   func(key string) redis.Result
	RPushCall                  func(key string, values ...interface{}) redis.Result
	LRangeCall                 func(key string, start, stop int64) redis.Result
	LTrimCall                  func(key string, start, stop int64) redis.Result
	LLenCall                   func(key string) redis.Result
	ExpireCall                 func(key string, value time.Duration) redis.Result
	TTLCall                    func(key string) redis.Result
	MGetCall                   func(keys []string) redis.Result
	SCardCall                  func(key string) redis.Result
	EvalCall                   func(script string, keys []string, args ...interface{}) redis.Result
	HIncrByCall                func(key string, field string, value int64) redis.Result
	HGetAllCall                func(key string) redis.Result
	HSetCall                   func(key string, hashKey string, value interface{}) redis.Result
	TypeCall                   func(key string) redis.Result
	PipelineCall               func() redis.Pipeline
	ScanCall                   func(cursor uint64, match string, count int64) redis.Result
}

MockClient mocks for testing purposes

func (*MockClient) ClusterCountKeysInSlot added in v5.0.1

func (m *MockClient) ClusterCountKeysInSlot(slot int) redis.Result

func (*MockClient) ClusterKeysInSlot added in v5.0.1

func (m *MockClient) ClusterKeysInSlot(slot int, count int) redis.Result

func (*MockClient) ClusterMode added in v5.0.1

func (m *MockClient) ClusterMode() bool

func (*MockClient) ClusterSlotForKey added in v5.0.1

func (m *MockClient) ClusterSlotForKey(key string) redis.Result

func (*MockClient) Decr

func (m *MockClient) Decr(key string) redis.Result

Decr mocks Decr

func (*MockClient) Del

func (m *MockClient) Del(keys ...string) redis.Result

Del mocks get

func (*MockClient) Eval

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

Eval mocks Eval

func (*MockClient) Exists

func (m *MockClient) Exists(keys ...string) redis.Result

Exists mocks set

func (*MockClient) Expire

func (m *MockClient) Expire(key string, value time.Duration) redis.Result

Expire mocks Expire

func (*MockClient) Get

func (m *MockClient) Get(key string) redis.Result

Get mocks get

func (*MockClient) HGetAll

func (m *MockClient) HGetAll(key string) redis.Result

HGetAll mocks HGetAll

func (*MockClient) HIncrBy

func (m *MockClient) HIncrBy(key string, field string, value int64) redis.Result

HIncrBy mocks HIncrByCall

func (*MockClient) HSet

func (m *MockClient) HSet(key string, hashKey string, value interface{}) redis.Result

HSet implements HGetAll wrapper for redis

func (*MockClient) Incr

func (m *MockClient) Incr(key string) redis.Result

Incr mocks Incr

func (*MockClient) Keys

func (m *MockClient) Keys(pattern string) redis.Result

Keys mocks keys

func (*MockClient) LLen

func (m *MockClient) LLen(key string) redis.Result

LLen mocks LLen

func (*MockClient) LRange

func (m *MockClient) LRange(key string, start, stop int64) redis.Result

LRange mocks LRange

func (*MockClient) LTrim

func (m *MockClient) LTrim(key string, start, stop int64) redis.Result

LTrim mocks LTrim

func (*MockClient) MGet

func (m *MockClient) MGet(keys []string) redis.Result

MGet mocks MGet

func (*MockClient) Ping

func (m *MockClient) Ping() redis.Result

Ping mocks ping

func (*MockClient) Pipeline

func (m *MockClient) Pipeline() redis.Pipeline

Pipeline mock

func (*MockClient) RPush

func (m *MockClient) RPush(key string, values ...interface{}) redis.Result

RPush mocks RPush

func (*MockClient) SAdd

func (m *MockClient) SAdd(key string, members ...interface{}) redis.Result

SAdd mocks SAdd

func (*MockClient) SCard

func (m *MockClient) SCard(key string) redis.Result

SCard mocks SCard

func (*MockClient) SIsMember

func (m *MockClient) SIsMember(key string, member interface{}) redis.Result

SIsMember mocks SIsMember

func (*MockClient) SMembers

func (m *MockClient) SMembers(key string) redis.Result

SMembers mocks SMembers

func (*MockClient) SRem

func (m *MockClient) SRem(key string, members ...interface{}) redis.Result

SRem mocks SRem

func (*MockClient) Scan added in v5.4.0

func (m *MockClient) Scan(cursor uint64, match string, count int64) redis.Result

Scan mock

func (*MockClient) Set

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

Set mocks set

func (*MockClient) TTL

func (m *MockClient) TTL(key string) redis.Result

TTL mocks TTL

func (*MockClient) Type

func (m *MockClient) Type(key string) redis.Result

Type implements Type wrapper for redis with prefix

type MockPipeline

type MockPipeline struct {
	LRangeCall   func(key string, start, stop int64)
	LTrimCall    func(key string, start, stop int64)
	LLenCall     func(key string)
	HIncrByCall  func(key string, field string, value int64)
	HLenCall     func(key string)
	SetCall      func(key string, value interface{}, expiration time.Duration)
	IncrCall     func(key string)
	DecrCall     func(key string)
	SAddCall     func(key string, members ...interface{})
	SRemCall     func(key string, members ...interface{})
	SMembersCall func(key string)
	DelCall      func(keys ...string)
	ExecCall     func() ([]redis.Result, error)
}

MpockPipeline impl

func (*MockPipeline) Decr added in v5.3.2

func (m *MockPipeline) Decr(key string)

func (*MockPipeline) Del added in v5.3.2

func (m *MockPipeline) Del(keys ...string)

func (*MockPipeline) Exec

func (m *MockPipeline) Exec() ([]redis.Result, error)

func (*MockPipeline) HIncrBy added in v5.2.2

func (m *MockPipeline) HIncrBy(key string, field string, value int64)

func (*MockPipeline) HLen added in v5.2.2

func (m *MockPipeline) HLen(key string)

func (*MockPipeline) Incr added in v5.3.2

func (m *MockPipeline) Incr(key string)

func (*MockPipeline) LLen

func (m *MockPipeline) LLen(key string)

func (*MockPipeline) LRange

func (m *MockPipeline) LRange(key string, start, stop int64)

func (*MockPipeline) LTrim

func (m *MockPipeline) LTrim(key string, start, stop int64)

func (*MockPipeline) SAdd added in v5.3.2

func (m *MockPipeline) SAdd(key string, members ...interface{})

func (*MockPipeline) SMembers added in v5.3.2

func (m *MockPipeline) SMembers(key string)

func (*MockPipeline) SRem added in v5.3.2

func (m *MockPipeline) SRem(key string, members ...interface{})

func (*MockPipeline) Set added in v5.3.2

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

type MockResultOutput

type MockResultOutput struct {
	ErrCall             func() error
	IntCall             func() int64
	StringCall          func() string
	BoolCall            func() bool
	DurationCall        func() time.Duration
	ResultCall          func() (int64, error)
	ResultStringCall    func() (string, error)
	MultiCall           func() ([]string, error)
	MultiInterfaceCall  func() ([]interface{}, error)
	MapStringStringCall func() (map[string]string, error)
}

MockResultOutput mocks struct

func (*MockResultOutput) Bool

func (m *MockResultOutput) Bool() bool

Bool mocks Bool

func (*MockResultOutput) Duration

func (m *MockResultOutput) Duration() time.Duration

Duration mocks Duration

func (*MockResultOutput) Err

func (m *MockResultOutput) Err() error

Err mocks Err

func (*MockResultOutput) Int

func (m *MockResultOutput) Int() int64

Int mocks Int

func (*MockResultOutput) MapStringString

func (m *MockResultOutput) MapStringString() (map[string]string, error)

MapStringString mocks MapStringString

func (*MockResultOutput) Multi

func (m *MockResultOutput) Multi() ([]string, error)

Multi mocks Multi

func (*MockResultOutput) MultiInterface

func (m *MockResultOutput) MultiInterface() ([]interface{}, error)

MultiInterface mocks MultiInterface

func (*MockResultOutput) Result

func (m *MockResultOutput) Result() (int64, error)

Result mocks Result

func (*MockResultOutput) ResultString

func (m *MockResultOutput) ResultString() (string, error)

ResultString mocks ResultString

func (*MockResultOutput) String

func (m *MockResultOutput) String() string

String mocks String

Jump to

Keyboard shortcuts

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