Documentation
¶
Index ¶
- type MockClient
- func (m *MockClient) ClusterCountKeysInSlot(slot int) redis.Result
- func (m *MockClient) ClusterKeysInSlot(slot int, count int) redis.Result
- func (m *MockClient) ClusterMode() bool
- func (m *MockClient) ClusterSlotForKey(key string) redis.Result
- func (m *MockClient) Decr(key string) redis.Result
- func (m *MockClient) Del(keys ...string) redis.Result
- func (m *MockClient) Eval(script string, keys []string, args ...interface{}) redis.Result
- func (m *MockClient) Exists(keys ...string) redis.Result
- func (m *MockClient) Expire(key string, value time.Duration) redis.Result
- func (m *MockClient) Get(key string) redis.Result
- func (m *MockClient) HGetAll(key string) redis.Result
- func (m *MockClient) HIncrBy(key string, field string, value int64) redis.Result
- func (m *MockClient) HSet(key string, hashKey string, value interface{}) redis.Result
- func (m *MockClient) Incr(key string) redis.Result
- func (m *MockClient) Keys(pattern string) redis.Result
- func (m *MockClient) LLen(key string) redis.Result
- func (m *MockClient) LRange(key string, start, stop int64) redis.Result
- func (m *MockClient) LTrim(key string, start, stop int64) redis.Result
- func (m *MockClient) MGet(keys []string) redis.Result
- func (m *MockClient) Ping() redis.Result
- func (m *MockClient) Pipeline() redis.Pipeline
- func (m *MockClient) RPush(key string, values ...interface{}) redis.Result
- func (m *MockClient) SAdd(key string, members ...interface{}) redis.Result
- func (m *MockClient) SCard(key string) redis.Result
- func (m *MockClient) SIsMember(key string, member interface{}) redis.Result
- func (m *MockClient) SMembers(key string) redis.Result
- func (m *MockClient) SRem(key string, members ...interface{}) redis.Result
- func (m *MockClient) Scan(cursor uint64, match string, count int64) redis.Result
- func (m *MockClient) Set(key string, value interface{}, expiration time.Duration) redis.Result
- func (m *MockClient) TTL(key string) redis.Result
- func (m *MockClient) Type(key string) redis.Result
- type MockPipeline
- func (m *MockPipeline) Decr(key string)
- func (m *MockPipeline) Del(keys ...string)
- func (m *MockPipeline) Exec() ([]redis.Result, error)
- func (m *MockPipeline) HIncrBy(key string, field string, value int64)
- func (m *MockPipeline) HLen(key string)
- func (m *MockPipeline) Incr(key string)
- func (m *MockPipeline) LLen(key string)
- func (m *MockPipeline) LRange(key string, start, stop int64)
- func (m *MockPipeline) LTrim(key string, start, stop int64)
- func (m *MockPipeline) SAdd(key string, members ...interface{})
- func (m *MockPipeline) SMembers(key string)
- func (m *MockPipeline) SRem(key string, members ...interface{})
- func (m *MockPipeline) Set(key string, value interface{}, expiration time.Duration)
- type MockResultOutput
- func (m *MockResultOutput) Bool() bool
- func (m *MockResultOutput) Duration() time.Duration
- func (m *MockResultOutput) Err() error
- func (m *MockResultOutput) Int() int64
- func (m *MockResultOutput) MapStringString() (map[string]string, error)
- func (m *MockResultOutput) Multi() ([]string, error)
- func (m *MockResultOutput) MultiInterface() ([]interface{}, error)
- func (m *MockResultOutput) Result() (int64, error)
- func (m *MockResultOutput) ResultString() (string, error)
- func (m *MockResultOutput) String() string
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) 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) HGetAll ¶
func (m *MockClient) HGetAll(key string) redis.Result
HGetAll mocks HGetAll
func (*MockClient) HSet ¶
func (m *MockClient) HSet(key string, hashKey string, value interface{}) redis.Result
HSet implements HGetAll wrapper for redis
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) 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) 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
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) 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{})
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) Duration ¶
func (m *MockResultOutput) Duration() time.Duration
Duration mocks Duration
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
Click to show internal directories.
Click to hide internal directories.