test

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMockCollection

func NewMockCollection(name, dbName string) *mockCollection

func SetupMockMongoDriver added in v0.7.0

func SetupMockMongoDriver() (*MockMongoClient, *MockMongoDatabase, *MockMongoCollection)

SetupMockMongoDriver creates a complete mock MongoDB driver setup

func SetupMockMongoWithOperations added in v0.7.0

func SetupMockMongoWithOperations() (*MockMongoClient, *MockMongoDatabase, *MockMongoCollection)

SetupMockMongoWithOperations creates a MongoDB mock with common operation mocks

Types

type MockDB

type MockDB struct {
	mock.Mock
}

MockDB is a mock implementation of the DB interface

func SetupMockDB

func SetupMockDB() *MockDB

Test helper functions

func (*MockDB) Aggregate

func (m *MockDB) Aggregate(ctx context.Context, col db.DbCollection, filter interface{}, opts ...*options.AggregateOptions) (*mongo.Cursor, error)

func (*MockDB) BulkWrite

func (m *MockDB) BulkWrite(ctx context.Context, col db.DbCollection, models []mongo.WriteModel, opts ...*options.BulkWriteOptions) (*mongo.BulkWriteResult, error)

func (*MockDB) CountDocuments

func (m *MockDB) CountDocuments(ctx context.Context, col db.DbCollection, filter interface{}, opts ...*options.CountOptions) (int64, error)

func (*MockDB) DeleteOne

func (m *MockDB) DeleteOne(ctx context.Context, col db.DbCollection, filter interface{}, opts ...*options.DeleteOptions) (*mongo.DeleteResult, error)

func (*MockDB) Disconnect

func (m *MockDB) Disconnect(ctx context.Context) error

func (*MockDB) Find

func (m *MockDB) Find(ctx context.Context, col db.DbCollection, filter interface{}, opts ...*options.FindOptions) (*mongo.Cursor, error)

func (*MockDB) FindOne

func (m *MockDB) FindOne(ctx context.Context, col db.DbCollection, filter interface{}, opts ...*options.FindOneOptions) *mongo.SingleResult

func (*MockDB) InsertOne

func (m *MockDB) InsertOne(ctx context.Context, col db.DbCollection, document interface{}, opts ...*options.InsertOneOptions) (*mongo.InsertOneResult, error)

func (*MockDB) SetDbInContext

func (m *MockDB) SetDbInContext(ctx context.Context) context.Context

func (*MockDB) UpdateMany

func (m *MockDB) UpdateMany(ctx context.Context, col db.DbCollection, filter interface{}, update interface{}, opts ...*options.UpdateOptions) (*mongo.UpdateResult, error)

func (*MockDB) UpdateOne

func (m *MockDB) UpdateOne(ctx context.Context, col db.DbCollection, filter interface{}, update interface{}, opts ...*options.UpdateOptions) (*mongo.UpdateResult, error)

type MockMongoClient added in v0.7.0

type MockMongoClient struct {
	mock.Mock
}

MockMongoClient is a mock implementation of mongo.Client

func (*MockMongoClient) Close added in v0.7.0

func (m *MockMongoClient) Close() error

func (*MockMongoClient) Database added in v0.7.0

func (m *MockMongoClient) Database(name string, opts ...*options.DatabaseOptions) *mongo.Database

func (*MockMongoClient) Disconnect added in v0.7.0

func (m *MockMongoClient) Disconnect(ctx context.Context) error

func (*MockMongoClient) EndSessions added in v0.7.0

func (m *MockMongoClient) EndSessions(ctx context.Context, sessions ...mongo.Session) error

func (*MockMongoClient) ListDatabaseNames added in v0.7.0

func (m *MockMongoClient) ListDatabaseNames(ctx context.Context, filter interface{}, opts ...*options.ListDatabasesOptions) ([]string, error)

func (*MockMongoClient) ListDatabases added in v0.7.0

func (m *MockMongoClient) ListDatabases(ctx context.Context, filter interface{}, opts ...*options.ListDatabasesOptions) (mongo.ListDatabasesResult, error)

func (*MockMongoClient) NumberSessionsInProgress added in v0.7.0

func (m *MockMongoClient) NumberSessionsInProgress() int

func (*MockMongoClient) Ping added in v0.7.0

func (*MockMongoClient) StartSession added in v0.7.0

func (m *MockMongoClient) StartSession(opts ...*options.SessionOptions) (mongo.Session, error)

func (*MockMongoClient) UseSession added in v0.7.0

func (m *MockMongoClient) UseSession(ctx context.Context, fn func(mongo.SessionContext) error) error

func (*MockMongoClient) UseSessionWithOptions added in v0.7.0

func (m *MockMongoClient) UseSessionWithOptions(ctx context.Context, opts *options.SessionOptions, fn func(mongo.SessionContext) error) error

func (*MockMongoClient) Watch added in v0.7.0

func (m *MockMongoClient) Watch(ctx context.Context, pipeline interface{}, opts ...*options.ChangeStreamOptions) (*mongo.ChangeStream, error)

type MockMongoCollection added in v0.7.0

type MockMongoCollection struct {
	mock.Mock
}

MockMongoCollection is a mock implementation of mongo.Collection

func (*MockMongoCollection) Aggregate added in v0.7.0

func (m *MockMongoCollection) Aggregate(ctx context.Context, pipeline interface{}, opts ...*options.AggregateOptions) (*mongo.Cursor, error)

func (*MockMongoCollection) BulkWrite added in v0.7.0

func (*MockMongoCollection) Clone added in v0.7.0

func (*MockMongoCollection) CountDocuments added in v0.7.0

func (m *MockMongoCollection) CountDocuments(ctx context.Context, filter interface{}, opts ...*options.CountOptions) (int64, error)

func (*MockMongoCollection) Database added in v0.7.0

func (m *MockMongoCollection) Database() *mongo.Database

func (*MockMongoCollection) DeleteMany added in v0.7.0

func (m *MockMongoCollection) DeleteMany(ctx context.Context, filter interface{}, opts ...*options.DeleteOptions) (*mongo.DeleteResult, error)

func (*MockMongoCollection) DeleteOne added in v0.7.0

func (m *MockMongoCollection) DeleteOne(ctx context.Context, filter interface{}, opts ...*options.DeleteOptions) (*mongo.DeleteResult, error)

func (*MockMongoCollection) Distinct added in v0.7.0

func (m *MockMongoCollection) Distinct(ctx context.Context, fieldName string, filter interface{}, opts ...*options.DistinctOptions) ([]interface{}, error)

func (*MockMongoCollection) Drop added in v0.7.0

func (*MockMongoCollection) EstimatedDocumentCount added in v0.7.0

func (m *MockMongoCollection) EstimatedDocumentCount(ctx context.Context, opts ...*options.EstimatedDocumentCountOptions) (int64, error)

func (*MockMongoCollection) Find added in v0.7.0

func (m *MockMongoCollection) Find(ctx context.Context, filter interface{}, opts ...*options.FindOptions) (*mongo.Cursor, error)

func (*MockMongoCollection) FindOne added in v0.7.0

func (m *MockMongoCollection) FindOne(ctx context.Context, filter interface{}, opts ...*options.FindOneOptions) *mongo.SingleResult

func (*MockMongoCollection) FindOneAndDelete added in v0.7.0

func (m *MockMongoCollection) FindOneAndDelete(ctx context.Context, filter interface{}, opts ...*options.FindOneAndDeleteOptions) *mongo.SingleResult

func (*MockMongoCollection) FindOneAndReplace added in v0.7.0

func (m *MockMongoCollection) FindOneAndReplace(ctx context.Context, filter interface{}, replacement interface{}, opts ...*options.FindOneAndReplaceOptions) *mongo.SingleResult

func (*MockMongoCollection) FindOneAndUpdate added in v0.7.0

func (m *MockMongoCollection) FindOneAndUpdate(ctx context.Context, filter interface{}, update interface{}, opts ...*options.FindOneAndUpdateOptions) *mongo.SingleResult

func (*MockMongoCollection) Indexes added in v0.7.0

func (m *MockMongoCollection) Indexes() mongo.IndexView

func (*MockMongoCollection) InsertMany added in v0.7.0

func (m *MockMongoCollection) InsertMany(ctx context.Context, documents []interface{}, opts ...*options.InsertManyOptions) (*mongo.InsertManyResult, error)

func (*MockMongoCollection) InsertOne added in v0.7.0

func (m *MockMongoCollection) InsertOne(ctx context.Context, document interface{}, opts ...*options.InsertOneOptions) (*mongo.InsertOneResult, error)

func (*MockMongoCollection) Name added in v0.7.0

func (m *MockMongoCollection) Name() string

func (*MockMongoCollection) ReadConcern added in v0.7.0

func (m *MockMongoCollection) ReadConcern() *readconcern.ReadConcern

func (*MockMongoCollection) ReadPreference added in v0.7.0

func (m *MockMongoCollection) ReadPreference() *readpref.ReadPref

func (*MockMongoCollection) ReplaceOne added in v0.7.0

func (m *MockMongoCollection) ReplaceOne(ctx context.Context, filter interface{}, replacement interface{}, opts ...*options.ReplaceOptions) (*mongo.UpdateResult, error)

func (*MockMongoCollection) UpdateMany added in v0.7.0

func (m *MockMongoCollection) UpdateMany(ctx context.Context, filter interface{}, update interface{}, opts ...*options.UpdateOptions) (*mongo.UpdateResult, error)

func (*MockMongoCollection) UpdateOne added in v0.7.0

func (m *MockMongoCollection) UpdateOne(ctx context.Context, filter interface{}, update interface{}, opts ...*options.UpdateOptions) (*mongo.UpdateResult, error)

func (*MockMongoCollection) Watch added in v0.7.0

func (m *MockMongoCollection) Watch(ctx context.Context, pipeline interface{}, opts ...*options.ChangeStreamOptions) (*mongo.ChangeStream, error)

func (*MockMongoCollection) WriteConcern added in v0.7.0

func (m *MockMongoCollection) WriteConcern() *writeconcern.WriteConcern

type MockMongoCursor added in v0.7.0

type MockMongoCursor struct {
	mock.Mock
}

MockMongoCursor is a mock implementation of mongo.Cursor

func (*MockMongoCursor) All added in v0.7.0

func (m *MockMongoCursor) All(ctx context.Context, results interface{}) error

func (*MockMongoCursor) BatchSize added in v0.7.0

func (m *MockMongoCursor) BatchSize() int32

func (*MockMongoCursor) Close added in v0.7.0

func (m *MockMongoCursor) Close(ctx context.Context) error

func (*MockMongoCursor) Decode added in v0.7.0

func (m *MockMongoCursor) Decode(v interface{}) error

func (*MockMongoCursor) DecodeBytes added in v0.7.0

func (m *MockMongoCursor) DecodeBytes() (bson.Raw, error)

func (*MockMongoCursor) Err added in v0.7.0

func (m *MockMongoCursor) Err() error

func (*MockMongoCursor) ID added in v0.7.0

func (m *MockMongoCursor) ID() int64

func (*MockMongoCursor) Next added in v0.7.0

func (m *MockMongoCursor) Next(ctx context.Context) bool

func (*MockMongoCursor) RemainingBatchLength added in v0.7.0

func (m *MockMongoCursor) RemainingBatchLength() int

func (*MockMongoCursor) SetAllowDiskUse added in v0.7.0

func (m *MockMongoCursor) SetAllowDiskUse(bool) *mongo.Cursor

func (*MockMongoCursor) SetAllowDiskUseFromCursor added in v0.7.0

func (m *MockMongoCursor) SetAllowDiskUseFromCursor(cursor *mongo.Cursor) *mongo.Cursor

func (*MockMongoCursor) SetAllowPartialResults added in v0.7.0

func (m *MockMongoCursor) SetAllowPartialResults(bool) *mongo.Cursor

func (*MockMongoCursor) SetAllowPartialResultsFromCursor added in v0.7.0

func (m *MockMongoCursor) SetAllowPartialResultsFromCursor(cursor *mongo.Cursor) *mongo.Cursor

func (*MockMongoCursor) SetBatchSize added in v0.7.0

func (m *MockMongoCursor) SetBatchSize(size int32) *mongo.Cursor

func (*MockMongoCursor) SetBatchSizeFromCursor added in v0.7.0

func (m *MockMongoCursor) SetBatchSizeFromCursor(cursor *mongo.Cursor) *mongo.Cursor

func (*MockMongoCursor) SetComment added in v0.7.0

func (m *MockMongoCursor) SetComment(comment interface{}) *mongo.Cursor

func (*MockMongoCursor) SetCursorType added in v0.7.0

func (m *MockMongoCursor) SetCursorType(ct int) *mongo.Cursor

func (*MockMongoCursor) SetHint added in v0.7.0

func (m *MockMongoCursor) SetHint(hint interface{}) *mongo.Cursor

func (*MockMongoCursor) SetLimit added in v0.7.0

func (m *MockMongoCursor) SetLimit(limit int64) *mongo.Cursor

func (*MockMongoCursor) SetMax added in v0.7.0

func (m *MockMongoCursor) SetMax(bson.Raw) *mongo.Cursor

func (*MockMongoCursor) SetMaxAwaitTime added in v0.7.0

func (m *MockMongoCursor) SetMaxAwaitTime(d time.Duration) *mongo.Cursor

func (*MockMongoCursor) SetMaxFromCursor added in v0.7.0

func (m *MockMongoCursor) SetMaxFromCursor(cursor *mongo.Cursor) *mongo.Cursor

func (*MockMongoCursor) SetMaxTime added in v0.7.0

func (m *MockMongoCursor) SetMaxTime(d time.Duration) *mongo.Cursor

func (*MockMongoCursor) SetMaxTimeFromCursor added in v0.7.0

func (m *MockMongoCursor) SetMaxTimeFromCursor(cursor *mongo.Cursor) *mongo.Cursor

func (*MockMongoCursor) SetMin added in v0.7.0

func (m *MockMongoCursor) SetMin(bson.Raw) *mongo.Cursor

func (*MockMongoCursor) SetMinFromCursor added in v0.7.0

func (m *MockMongoCursor) SetMinFromCursor(cursor *mongo.Cursor) *mongo.Cursor

func (*MockMongoCursor) SetNoCursorTimeout added in v0.7.0

func (m *MockMongoCursor) SetNoCursorTimeout(bool) *mongo.Cursor

func (*MockMongoCursor) SetNoCursorTimeoutFromCursor added in v0.7.0

func (m *MockMongoCursor) SetNoCursorTimeoutFromCursor(cursor *mongo.Cursor) *mongo.Cursor

func (*MockMongoCursor) SetOplogReplay added in v0.7.0

func (m *MockMongoCursor) SetOplogReplay(bool) *mongo.Cursor

func (*MockMongoCursor) SetOplogReplayFromCursor added in v0.7.0

func (m *MockMongoCursor) SetOplogReplayFromCursor(cursor *mongo.Cursor) *mongo.Cursor

func (*MockMongoCursor) SetPartial added in v0.7.0

func (m *MockMongoCursor) SetPartial(bool) *mongo.Cursor

func (*MockMongoCursor) SetPartialFromCursor added in v0.7.0

func (m *MockMongoCursor) SetPartialFromCursor(cursor *mongo.Cursor) *mongo.Cursor

func (*MockMongoCursor) SetReturnKey added in v0.7.0

func (m *MockMongoCursor) SetReturnKey(bool) *mongo.Cursor

func (*MockMongoCursor) SetReturnKeyFromCursor added in v0.7.0

func (m *MockMongoCursor) SetReturnKeyFromCursor(cursor *mongo.Cursor) *mongo.Cursor

func (*MockMongoCursor) SetShowRecordID added in v0.7.0

func (m *MockMongoCursor) SetShowRecordID(bool) *mongo.Cursor

func (*MockMongoCursor) SetShowRecordIDFromCursor added in v0.7.0

func (m *MockMongoCursor) SetShowRecordIDFromCursor(cursor *mongo.Cursor) *mongo.Cursor

func (*MockMongoCursor) SetSnapshot added in v0.7.0

func (m *MockMongoCursor) SetSnapshot(bool) *mongo.Cursor

func (*MockMongoCursor) SetSnapshotFromCursor added in v0.7.0

func (m *MockMongoCursor) SetSnapshotFromCursor(cursor *mongo.Cursor) *mongo.Cursor

func (*MockMongoCursor) SetSort added in v0.7.0

func (m *MockMongoCursor) SetSort(interface{}) *mongo.Cursor

func (*MockMongoCursor) SetSortFromCursor added in v0.7.0

func (m *MockMongoCursor) SetSortFromCursor(cursor *mongo.Cursor) *mongo.Cursor

func (*MockMongoCursor) SetTailable added in v0.7.0

func (m *MockMongoCursor) SetTailable(bool) *mongo.Cursor

func (*MockMongoCursor) SetTailableFromCursor added in v0.7.0

func (m *MockMongoCursor) SetTailableFromCursor(cursor *mongo.Cursor) *mongo.Cursor

func (*MockMongoCursor) TryNext added in v0.7.0

func (m *MockMongoCursor) TryNext(ctx context.Context) bool

type MockMongoDatabase added in v0.7.0

type MockMongoDatabase struct {
	mock.Mock
}

MockMongoDatabase is a mock implementation of mongo.Database

func (*MockMongoDatabase) Aggregate added in v0.7.0

func (m *MockMongoDatabase) Aggregate(ctx context.Context, pipeline interface{}, opts ...*options.AggregateOptions) (*mongo.Cursor, error)

func (*MockMongoDatabase) Client added in v0.7.0

func (m *MockMongoDatabase) Client() *mongo.Client

func (*MockMongoDatabase) Collection added in v0.7.0

func (m *MockMongoDatabase) Collection(name string, opts ...*options.CollectionOptions) *mongo.Collection

func (*MockMongoDatabase) Drop added in v0.7.0

func (m *MockMongoDatabase) Drop(ctx context.Context) error

func (*MockMongoDatabase) ListCollectionNames added in v0.7.0

func (m *MockMongoDatabase) ListCollectionNames(ctx context.Context, filter interface{}, opts ...*options.ListCollectionsOptions) ([]string, error)

func (*MockMongoDatabase) ListCollections added in v0.7.0

func (m *MockMongoDatabase) ListCollections(ctx context.Context, filter interface{}, opts ...*options.ListCollectionsOptions) (*mongo.Cursor, error)

func (*MockMongoDatabase) Name added in v0.7.0

func (m *MockMongoDatabase) Name() string

func (*MockMongoDatabase) ReadConcern added in v0.7.0

func (m *MockMongoDatabase) ReadConcern() *readconcern.ReadConcern

func (*MockMongoDatabase) ReadPreference added in v0.7.0

func (m *MockMongoDatabase) ReadPreference() *readpref.ReadPref

func (*MockMongoDatabase) RunCommand added in v0.7.0

func (m *MockMongoDatabase) RunCommand(ctx context.Context, runCommand interface{}, opts ...*options.RunCmdOptions) *mongo.SingleResult

func (*MockMongoDatabase) RunCommandCursor added in v0.7.0

func (m *MockMongoDatabase) RunCommandCursor(ctx context.Context, runCommand interface{}, opts ...*options.RunCmdOptions) (*mongo.Cursor, error)

func (*MockMongoDatabase) WriteConcern added in v0.7.0

func (m *MockMongoDatabase) WriteConcern() *writeconcern.WriteConcern

type MockMongoSingleResult added in v0.7.0

type MockMongoSingleResult struct {
	mock.Mock
}

MockMongoSingleResult is a mock implementation of mongo.SingleResult

func (*MockMongoSingleResult) Decode added in v0.7.0

func (m *MockMongoSingleResult) Decode(v interface{}) error

func (*MockMongoSingleResult) DecodeBytes added in v0.7.0

func (m *MockMongoSingleResult) DecodeBytes() (bson.Raw, error)

func (*MockMongoSingleResult) Err added in v0.7.0

func (m *MockMongoSingleResult) Err() error

type MockRedisBoolCmd added in v0.7.0

type MockRedisBoolCmd struct {
	MockRedisCmd
}

MockRedisBoolCmd is a mock implementation of redis.BoolCmd

func (*MockRedisBoolCmd) Result added in v0.7.0

func (m *MockRedisBoolCmd) Result() (bool, error)

func (*MockRedisBoolCmd) Val added in v0.7.0

func (m *MockRedisBoolCmd) Val() bool

type MockRedisClient added in v0.7.0

type MockRedisClient struct {
	mock.Mock
}

MockRedisClient is a mock implementation of redis.Client

func SetupMockRedisDriver added in v0.7.0

func SetupMockRedisDriver() *MockRedisClient

SetupMockRedisDriver creates a complete mock Redis driver setup

func (*MockRedisClient) AddHook added in v0.7.0

func (m *MockRedisClient) AddHook(hook redis.Hook)

func (*MockRedisClient) Append added in v0.7.0

func (m *MockRedisClient) Append(ctx context.Context, key, value string) *redis.IntCmd

func (*MockRedisClient) BitCount added in v0.7.0

func (m *MockRedisClient) BitCount(ctx context.Context, key string, bitCount *redis.BitCount) *redis.IntCmd

func (*MockRedisClient) BitOpAnd added in v0.7.0

func (m *MockRedisClient) BitOpAnd(ctx context.Context, destKey string, keys ...string) *redis.IntCmd

func (*MockRedisClient) BitOpNot added in v0.7.0

func (m *MockRedisClient) BitOpNot(ctx context.Context, destKey, key string) *redis.IntCmd

func (*MockRedisClient) BitOpOr added in v0.7.0

func (m *MockRedisClient) BitOpOr(ctx context.Context, destKey string, keys ...string) *redis.IntCmd

func (*MockRedisClient) BitOpXor added in v0.7.0

func (m *MockRedisClient) BitOpXor(ctx context.Context, destKey string, keys ...string) *redis.IntCmd

func (*MockRedisClient) BitPos added in v0.7.0

func (m *MockRedisClient) BitPos(ctx context.Context, key string, bit int64, pos ...int64) *redis.IntCmd

func (*MockRedisClient) ClientGetName added in v0.7.0

func (m *MockRedisClient) ClientGetName(ctx context.Context) *redis.StringCmd

func (*MockRedisClient) Close added in v0.7.0

func (m *MockRedisClient) Close() error

func (*MockRedisClient) Decr added in v0.7.0

func (m *MockRedisClient) Decr(ctx context.Context, key string) *redis.IntCmd

func (*MockRedisClient) DecrBy added in v0.7.0

func (m *MockRedisClient) DecrBy(ctx context.Context, key string, decrement int64) *redis.IntCmd

func (*MockRedisClient) Del added in v0.7.0

func (m *MockRedisClient) Del(ctx context.Context, keys ...string) *redis.IntCmd

func (*MockRedisClient) Do added in v0.7.0

func (m *MockRedisClient) Do(ctx context.Context, args ...interface{}) *redis.Cmd

func (*MockRedisClient) Dump added in v0.7.0

func (m *MockRedisClient) Dump(ctx context.Context, key string) *redis.StringCmd

func (*MockRedisClient) Echo added in v0.7.0

func (m *MockRedisClient) Echo(ctx context.Context, message interface{}) *redis.StringCmd

func (*MockRedisClient) Exists added in v0.7.0

func (m *MockRedisClient) Exists(ctx context.Context, keys ...string) *redis.IntCmd

func (*MockRedisClient) Expire added in v0.7.0

func (m *MockRedisClient) Expire(ctx context.Context, key string, expiration time.Duration) *redis.BoolCmd

func (*MockRedisClient) ExpireAt added in v0.7.0

func (m *MockRedisClient) ExpireAt(ctx context.Context, key string, tm time.Time) *redis.BoolCmd

func (*MockRedisClient) Get added in v0.7.0

func (*MockRedisClient) GetBit added in v0.7.0

func (m *MockRedisClient) GetBit(ctx context.Context, key string, offset int64) *redis.IntCmd

func (*MockRedisClient) GetRange added in v0.7.0

func (m *MockRedisClient) GetRange(ctx context.Context, key string, start, end int64) *redis.StringCmd

func (*MockRedisClient) GetSet added in v0.7.0

func (m *MockRedisClient) GetSet(ctx context.Context, key string, value interface{}) *redis.StringCmd

func (*MockRedisClient) HScan added in v0.7.0

func (m *MockRedisClient) HScan(ctx context.Context, key string, cursor uint64, match string, count int64) *redis.ScanCmd

func (*MockRedisClient) Incr added in v0.7.0

func (m *MockRedisClient) Incr(ctx context.Context, key string) *redis.IntCmd

func (*MockRedisClient) IncrBy added in v0.7.0

func (m *MockRedisClient) IncrBy(ctx context.Context, key string, value int64) *redis.IntCmd

func (*MockRedisClient) IncrByFloat added in v0.7.0

func (m *MockRedisClient) IncrByFloat(ctx context.Context, key string, value float64) *redis.FloatCmd

func (*MockRedisClient) Keys added in v0.7.0

func (m *MockRedisClient) Keys(ctx context.Context, pattern string) *redis.StringSliceCmd

func (*MockRedisClient) MGet added in v0.7.0

func (m *MockRedisClient) MGet(ctx context.Context, keys ...string) *redis.SliceCmd

func (*MockRedisClient) MSet added in v0.7.0

func (m *MockRedisClient) MSet(ctx context.Context, values ...interface{}) *redis.StatusCmd

func (*MockRedisClient) MSetNX added in v0.7.0

func (m *MockRedisClient) MSetNX(ctx context.Context, values ...interface{}) *redis.BoolCmd

func (*MockRedisClient) Migrate added in v0.7.0

func (m *MockRedisClient) Migrate(ctx context.Context, host, port, key string, db int, timeout time.Duration) *redis.StatusCmd

func (*MockRedisClient) Move added in v0.7.0

func (m *MockRedisClient) Move(ctx context.Context, key string, db int) *redis.BoolCmd

func (*MockRedisClient) ObjectEncoding added in v0.7.0

func (m *MockRedisClient) ObjectEncoding(ctx context.Context, key string) *redis.StringCmd

func (*MockRedisClient) ObjectIdleTime added in v0.7.0

func (m *MockRedisClient) ObjectIdleTime(ctx context.Context, key string) *redis.DurationCmd

func (*MockRedisClient) ObjectRefCount added in v0.7.0

func (m *MockRedisClient) ObjectRefCount(ctx context.Context, key string) *redis.IntCmd

func (*MockRedisClient) PExpire added in v0.7.0

func (m *MockRedisClient) PExpire(ctx context.Context, key string, expiration time.Duration) *redis.BoolCmd

func (*MockRedisClient) PExpireAt added in v0.7.0

func (m *MockRedisClient) PExpireAt(ctx context.Context, key string, tm time.Time) *redis.BoolCmd

func (*MockRedisClient) PSubscribe added in v0.7.0

func (m *MockRedisClient) PSubscribe(ctx context.Context, channels ...string) *redis.PubSub

func (*MockRedisClient) PTTL added in v0.7.0

func (*MockRedisClient) Persist added in v0.7.0

func (m *MockRedisClient) Persist(ctx context.Context, key string) *redis.BoolCmd

func (*MockRedisClient) Ping added in v0.7.0

func (*MockRedisClient) Pipeline added in v0.7.0

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

func (*MockRedisClient) Pipelined added in v0.7.0

func (m *MockRedisClient) Pipelined(ctx context.Context, fn func(redis.Pipeliner) error) ([]redis.Cmder, error)

func (*MockRedisClient) PoolStats added in v0.7.0

func (m *MockRedisClient) PoolStats() *redis.PoolStats

func (*MockRedisClient) Process added in v0.7.0

func (m *MockRedisClient) Process(ctx context.Context, cmd redis.Cmder) error

func (*MockRedisClient) ProcessMulti added in v0.7.0

func (m *MockRedisClient) ProcessMulti(ctx context.Context, cmds []redis.Cmder) error

func (*MockRedisClient) ProcessPipeline added in v0.7.0

func (m *MockRedisClient) ProcessPipeline(ctx context.Context, cmds []redis.Cmder) error

func (*MockRedisClient) Quit added in v0.7.0

func (*MockRedisClient) RandomKey added in v0.7.0

func (m *MockRedisClient) RandomKey(ctx context.Context) *redis.StringCmd

func (*MockRedisClient) Rename added in v0.7.0

func (m *MockRedisClient) Rename(ctx context.Context, key, newkey string) *redis.StatusCmd

func (*MockRedisClient) RenameNX added in v0.7.0

func (m *MockRedisClient) RenameNX(ctx context.Context, key, newkey string) *redis.BoolCmd

func (*MockRedisClient) Restore added in v0.7.0

func (m *MockRedisClient) Restore(ctx context.Context, key string, ttl time.Duration, value string) *redis.StatusCmd

func (*MockRedisClient) RestoreReplace added in v0.7.0

func (m *MockRedisClient) RestoreReplace(ctx context.Context, key string, ttl time.Duration, value string) *redis.StatusCmd

func (*MockRedisClient) SScan added in v0.7.0

func (m *MockRedisClient) SScan(ctx context.Context, key string, cursor uint64, match string, count int64) *redis.ScanCmd

func (*MockRedisClient) SSubscribe added in v0.7.0

func (m *MockRedisClient) SSubscribe(ctx context.Context, channels ...string) *redis.PubSub

func (*MockRedisClient) Scan added in v0.7.0

func (m *MockRedisClient) Scan(ctx context.Context, cursor uint64, match string, count int64) *redis.ScanCmd

func (*MockRedisClient) Set added in v0.7.0

func (m *MockRedisClient) Set(ctx context.Context, key string, value interface{}, expiration time.Duration) *redis.StatusCmd

func (*MockRedisClient) SetBit added in v0.7.0

func (m *MockRedisClient) SetBit(ctx context.Context, key string, offset int64, value int) *redis.IntCmd

func (*MockRedisClient) SetRange added in v0.7.0

func (m *MockRedisClient) SetRange(ctx context.Context, key string, offset int64, value string) *redis.IntCmd

func (*MockRedisClient) Sort added in v0.7.0

func (m *MockRedisClient) Sort(ctx context.Context, key string, sort *redis.Sort) *redis.StringSliceCmd

func (*MockRedisClient) SortInterfaces added in v0.7.0

func (m *MockRedisClient) SortInterfaces(ctx context.Context, key string, sort *redis.Sort) *redis.SliceCmd

func (*MockRedisClient) SortStore added in v0.7.0

func (m *MockRedisClient) SortStore(ctx context.Context, key, store string, sort *redis.Sort) *redis.IntCmd

func (*MockRedisClient) StrLen added in v0.7.0

func (m *MockRedisClient) StrLen(ctx context.Context, key string) *redis.IntCmd

func (*MockRedisClient) Subscribe added in v0.7.0

func (m *MockRedisClient) Subscribe(ctx context.Context, channels ...string) *redis.PubSub

func (*MockRedisClient) TTL added in v0.7.0

func (*MockRedisClient) Touch added in v0.7.0

func (m *MockRedisClient) Touch(ctx context.Context, keys ...string) *redis.IntCmd

func (*MockRedisClient) TxPipeline added in v0.7.0

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

func (*MockRedisClient) TxPipelined added in v0.7.0

func (m *MockRedisClient) TxPipelined(ctx context.Context, fn func(redis.Pipeliner) error) ([]redis.Cmder, error)

func (*MockRedisClient) Type added in v0.7.0

func (m *MockRedisClient) Type(ctx context.Context, key string) *redis.StatusCmd
func (m *MockRedisClient) Unlink(ctx context.Context, keys ...string) *redis.IntCmd

func (*MockRedisClient) Watch added in v0.7.0

func (m *MockRedisClient) Watch(ctx context.Context, fn func(*redis.Tx) error, keys ...string) error

func (*MockRedisClient) ZScan added in v0.7.0

func (m *MockRedisClient) ZScan(ctx context.Context, key string, cursor uint64, match string, count int64) *redis.ScanCmd

type MockRedisCmd added in v0.7.0

type MockRedisCmd struct {
	mock.Mock
}

MockRedisCmd is a mock implementation of redis.Cmd

func (*MockRedisCmd) Args added in v0.7.0

func (m *MockRedisCmd) Args() []interface{}

func (*MockRedisCmd) Err added in v0.7.0

func (m *MockRedisCmd) Err() error

func (*MockRedisCmd) FullName added in v0.7.0

func (m *MockRedisCmd) FullName() string

func (*MockRedisCmd) Name added in v0.7.0

func (m *MockRedisCmd) Name() string

func (*MockRedisCmd) SetFirstKeyPos added in v0.7.0

func (m *MockRedisCmd) SetFirstKeyPos(keyPos int8)

func (*MockRedisCmd) SetReadTimeout added in v0.7.0

func (m *MockRedisCmd) SetReadTimeout(timeout time.Duration)

func (*MockRedisCmd) SetWriteTimeout added in v0.7.0

func (m *MockRedisCmd) SetWriteTimeout(timeout time.Duration)

func (*MockRedisCmd) String added in v0.7.0

func (m *MockRedisCmd) String() string

func (*MockRedisCmd) Val added in v0.7.0

func (m *MockRedisCmd) Val() interface{}

type MockRedisDurationCmd added in v0.7.0

type MockRedisDurationCmd struct {
	MockRedisCmd
}

MockRedisDurationCmd is a mock implementation of redis.DurationCmd

func (*MockRedisDurationCmd) Result added in v0.7.0

func (m *MockRedisDurationCmd) Result() (time.Duration, error)

func (*MockRedisDurationCmd) Val added in v0.7.0

type MockRedisFloatCmd added in v0.7.0

type MockRedisFloatCmd struct {
	MockRedisCmd
}

MockRedisFloatCmd is a mock implementation of redis.FloatCmd

func (*MockRedisFloatCmd) Result added in v0.7.0

func (m *MockRedisFloatCmd) Result() (float64, error)

func (*MockRedisFloatCmd) Val added in v0.7.0

func (m *MockRedisFloatCmd) Val() float64

type MockRedisIntCmd added in v0.7.0

type MockRedisIntCmd struct {
	MockRedisCmd
}

MockRedisIntCmd is a mock implementation of redis.IntCmd

func (*MockRedisIntCmd) Result added in v0.7.0

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

func (*MockRedisIntCmd) Val added in v0.7.0

func (m *MockRedisIntCmd) Val() int64

type MockRedisPipeliner added in v0.7.0

type MockRedisPipeliner struct {
	mock.Mock
}

MockRedisPipeliner is a mock implementation of redis.Pipeliner

func (*MockRedisPipeliner) AddHook added in v0.7.0

func (m *MockRedisPipeliner) AddHook(hook redis.Hook)

func (*MockRedisPipeliner) Close added in v0.7.0

func (m *MockRedisPipeliner) Close() error

func (*MockRedisPipeliner) Discard added in v0.7.0

func (m *MockRedisPipeliner) Discard() error

func (*MockRedisPipeliner) Do added in v0.7.0

func (m *MockRedisPipeliner) Do(ctx context.Context, args ...interface{}) *redis.Cmd

func (*MockRedisPipeliner) Exec added in v0.7.0

func (m *MockRedisPipeliner) Exec(ctx context.Context) ([]redis.Cmder, error)

func (*MockRedisPipeliner) ExecVal added in v0.7.0

func (m *MockRedisPipeliner) ExecVal(ctx context.Context, fn func(redis.Pipeliner) error) ([]redis.Cmder, error)

func (*MockRedisPipeliner) Len added in v0.7.0

func (m *MockRedisPipeliner) Len() int

func (*MockRedisPipeliner) Process added in v0.7.0

func (m *MockRedisPipeliner) Process(ctx context.Context, cmd redis.Cmder) error

func (*MockRedisPipeliner) ProcessMulti added in v0.7.0

func (m *MockRedisPipeliner) ProcessMulti(ctx context.Context, cmds []redis.Cmder) error

func (*MockRedisPipeliner) ProcessPipeline added in v0.7.0

func (m *MockRedisPipeliner) ProcessPipeline(ctx context.Context, cmds []redis.Cmder) error

func (*MockRedisPipeliner) SetErr added in v0.7.0

func (m *MockRedisPipeliner) SetErr(e error)

func (*MockRedisPipeliner) SetVal added in v0.7.0

func (m *MockRedisPipeliner) SetVal(val interface{})

type MockRedisPubSub added in v0.7.0

type MockRedisPubSub struct {
	mock.Mock
}

MockRedisPubSub is a mock implementation of redis.PubSub

func (*MockRedisPubSub) Channel added in v0.7.0

func (m *MockRedisPubSub) Channel() <-chan *redis.Message

func (*MockRedisPubSub) ChannelSize added in v0.7.0

func (m *MockRedisPubSub) ChannelSize(size int) <-chan *redis.Message

func (*MockRedisPubSub) ChannelWithSubscriptions added in v0.7.0

func (m *MockRedisPubSub) ChannelWithSubscriptions(ctx context.Context, bufferSize int) <-chan interface{}

func (*MockRedisPubSub) Close added in v0.7.0

func (m *MockRedisPubSub) Close() error

func (*MockRedisPubSub) PSubscribe added in v0.7.0

func (m *MockRedisPubSub) PSubscribe(ctx context.Context, channels ...string) error

func (*MockRedisPubSub) PUnsubscribe added in v0.7.0

func (m *MockRedisPubSub) PUnsubscribe(ctx context.Context, channels ...string) error

func (*MockRedisPubSub) Ping added in v0.7.0

func (m *MockRedisPubSub) Ping(ctx context.Context, payload string) error

func (*MockRedisPubSub) Receive added in v0.7.0

func (m *MockRedisPubSub) Receive(ctx context.Context) (interface{}, error)

func (*MockRedisPubSub) ReceiveMessage added in v0.7.0

func (m *MockRedisPubSub) ReceiveMessage(ctx context.Context) (*redis.Message, error)

func (*MockRedisPubSub) ReceiveTimeout added in v0.7.0

func (m *MockRedisPubSub) ReceiveTimeout(ctx context.Context, timeout time.Duration) (interface{}, error)

func (*MockRedisPubSub) SSubscribe added in v0.7.0

func (m *MockRedisPubSub) SSubscribe(ctx context.Context, channels ...string) error

func (*MockRedisPubSub) SUnsubscribe added in v0.7.0

func (m *MockRedisPubSub) SUnsubscribe(ctx context.Context, channels ...string) error

func (*MockRedisPubSub) SetErr added in v0.7.0

func (m *MockRedisPubSub) SetErr(e error)

func (*MockRedisPubSub) SetVal added in v0.7.0

func (m *MockRedisPubSub) SetVal(val interface{})

func (*MockRedisPubSub) String added in v0.7.0

func (m *MockRedisPubSub) String() string

func (*MockRedisPubSub) Subscribe added in v0.7.0

func (m *MockRedisPubSub) Subscribe(ctx context.Context, channels ...string) error

func (*MockRedisPubSub) Unsubscribe added in v0.7.0

func (m *MockRedisPubSub) Unsubscribe(ctx context.Context, channels ...string) error

func (*MockRedisPubSub) WithChannelSize added in v0.7.0

func (m *MockRedisPubSub) WithChannelSize(size int) *redis.PubSub

func (*MockRedisPubSub) WithChannels added in v0.7.0

func (m *MockRedisPubSub) WithChannels(channels ...string) *redis.PubSub

type MockRedisScanCmd added in v0.7.0

type MockRedisScanCmd struct {
	MockRedisCmd
}

MockRedisScanCmd is a mock implementation of redis.ScanCmd

func (*MockRedisScanCmd) Result added in v0.7.0

func (m *MockRedisScanCmd) Result() (keys []string, cursor uint64, err error)

func (*MockRedisScanCmd) Val added in v0.7.0

func (m *MockRedisScanCmd) Val() (keys []string, cursor uint64)

type MockRedisSliceCmd added in v0.7.0

type MockRedisSliceCmd struct {
	MockRedisCmd
}

MockRedisSliceCmd is a mock implementation of redis.SliceCmd

func (*MockRedisSliceCmd) Result added in v0.7.0

func (m *MockRedisSliceCmd) Result() ([]interface{}, error)

func (*MockRedisSliceCmd) Val added in v0.7.0

func (m *MockRedisSliceCmd) Val() []interface{}

type MockRedisStatusCmd added in v0.7.0

type MockRedisStatusCmd struct {
	MockRedisCmd
}

MockRedisStatusCmd is a mock implementation of redis.StatusCmd

func (*MockRedisStatusCmd) Result added in v0.7.0

func (m *MockRedisStatusCmd) Result() (string, error)

func (*MockRedisStatusCmd) Val added in v0.7.0

func (m *MockRedisStatusCmd) Val() string

type MockRedisStringCmd added in v0.7.0

type MockRedisStringCmd struct {
	MockRedisCmd
}

MockRedisStringCmd is a mock implementation of redis.StringCmd

func (*MockRedisStringCmd) Result added in v0.7.0

func (m *MockRedisStringCmd) Result() (string, error)

func (*MockRedisStringCmd) Val added in v0.7.0

func (m *MockRedisStringCmd) Val() string

type MockRedisStringSliceCmd added in v0.7.0

type MockRedisStringSliceCmd struct {
	MockRedisCmd
}

MockRedisStringSliceCmd is a mock implementation of redis.StringSliceCmd

func (*MockRedisStringSliceCmd) Result added in v0.7.0

func (m *MockRedisStringSliceCmd) Result() ([]string, error)

func (*MockRedisStringSliceCmd) Val added in v0.7.0

func (m *MockRedisStringSliceCmd) Val() []string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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