Documentation
¶
Index ¶
- func NewMockCollection(name, dbName string) *mockCollection
- func SetupMockMongoDriver() (*MockMongoClient, *MockMongoDatabase, *MockMongoCollection)
- func SetupMockMongoWithOperations() (*MockMongoClient, *MockMongoDatabase, *MockMongoCollection)
- type MockDB
- func (m *MockDB) Aggregate(ctx context.Context, col db.DbCollection, filter interface{}, ...) (*mongo.Cursor, error)
- func (m *MockDB) BulkWrite(ctx context.Context, col db.DbCollection, models []mongo.WriteModel, ...) (*mongo.BulkWriteResult, error)
- func (m *MockDB) CountDocuments(ctx context.Context, col db.DbCollection, filter interface{}, ...) (int64, error)
- func (m *MockDB) DeleteOne(ctx context.Context, col db.DbCollection, filter interface{}, ...) (*mongo.DeleteResult, error)
- func (m *MockDB) Disconnect(ctx context.Context) error
- func (m *MockDB) Find(ctx context.Context, col db.DbCollection, filter interface{}, ...) (*mongo.Cursor, error)
- func (m *MockDB) FindOne(ctx context.Context, col db.DbCollection, filter interface{}, ...) *mongo.SingleResult
- func (m *MockDB) InsertOne(ctx context.Context, col db.DbCollection, document interface{}, ...) (*mongo.InsertOneResult, error)
- func (m *MockDB) SetDbInContext(ctx context.Context) context.Context
- func (m *MockDB) UpdateMany(ctx context.Context, col db.DbCollection, filter interface{}, ...) (*mongo.UpdateResult, error)
- func (m *MockDB) UpdateOne(ctx context.Context, col db.DbCollection, filter interface{}, ...) (*mongo.UpdateResult, error)
- type MockMongoClient
- func (m *MockMongoClient) Close() error
- func (m *MockMongoClient) Database(name string, opts ...*options.DatabaseOptions) *mongo.Database
- func (m *MockMongoClient) Disconnect(ctx context.Context) error
- func (m *MockMongoClient) EndSessions(ctx context.Context, sessions ...mongo.Session) error
- func (m *MockMongoClient) ListDatabaseNames(ctx context.Context, filter interface{}, opts ...*options.ListDatabasesOptions) ([]string, error)
- func (m *MockMongoClient) ListDatabases(ctx context.Context, filter interface{}, opts ...*options.ListDatabasesOptions) (mongo.ListDatabasesResult, error)
- func (m *MockMongoClient) NumberSessionsInProgress() int
- func (m *MockMongoClient) Ping(ctx context.Context, rp *readpref.ReadPref) error
- func (m *MockMongoClient) StartSession(opts ...*options.SessionOptions) (mongo.Session, error)
- func (m *MockMongoClient) UseSession(ctx context.Context, fn func(mongo.SessionContext) error) error
- func (m *MockMongoClient) UseSessionWithOptions(ctx context.Context, opts *options.SessionOptions, ...) error
- func (m *MockMongoClient) Watch(ctx context.Context, pipeline interface{}, ...) (*mongo.ChangeStream, error)
- type MockMongoCollection
- func (m *MockMongoCollection) Aggregate(ctx context.Context, pipeline interface{}, opts ...*options.AggregateOptions) (*mongo.Cursor, error)
- func (m *MockMongoCollection) BulkWrite(ctx context.Context, models []mongo.WriteModel, ...) (*mongo.BulkWriteResult, error)
- func (m *MockMongoCollection) Clone(opts ...*options.CollectionOptions) (*mongo.Collection, error)
- func (m *MockMongoCollection) CountDocuments(ctx context.Context, filter interface{}, opts ...*options.CountOptions) (int64, error)
- func (m *MockMongoCollection) Database() *mongo.Database
- func (m *MockMongoCollection) DeleteMany(ctx context.Context, filter interface{}, opts ...*options.DeleteOptions) (*mongo.DeleteResult, error)
- func (m *MockMongoCollection) DeleteOne(ctx context.Context, filter interface{}, opts ...*options.DeleteOptions) (*mongo.DeleteResult, error)
- func (m *MockMongoCollection) Distinct(ctx context.Context, fieldName string, filter interface{}, ...) ([]interface{}, error)
- func (m *MockMongoCollection) Drop(ctx context.Context) error
- func (m *MockMongoCollection) EstimatedDocumentCount(ctx context.Context, opts ...*options.EstimatedDocumentCountOptions) (int64, error)
- func (m *MockMongoCollection) Find(ctx context.Context, filter interface{}, opts ...*options.FindOptions) (*mongo.Cursor, error)
- func (m *MockMongoCollection) FindOne(ctx context.Context, filter interface{}, opts ...*options.FindOneOptions) *mongo.SingleResult
- func (m *MockMongoCollection) FindOneAndDelete(ctx context.Context, filter interface{}, ...) *mongo.SingleResult
- func (m *MockMongoCollection) FindOneAndReplace(ctx context.Context, filter interface{}, replacement interface{}, ...) *mongo.SingleResult
- func (m *MockMongoCollection) FindOneAndUpdate(ctx context.Context, filter interface{}, update interface{}, ...) *mongo.SingleResult
- func (m *MockMongoCollection) Indexes() mongo.IndexView
- func (m *MockMongoCollection) InsertMany(ctx context.Context, documents []interface{}, ...) (*mongo.InsertManyResult, error)
- func (m *MockMongoCollection) InsertOne(ctx context.Context, document interface{}, opts ...*options.InsertOneOptions) (*mongo.InsertOneResult, error)
- func (m *MockMongoCollection) Name() string
- func (m *MockMongoCollection) ReadConcern() *readconcern.ReadConcern
- func (m *MockMongoCollection) ReadPreference() *readpref.ReadPref
- func (m *MockMongoCollection) ReplaceOne(ctx context.Context, filter interface{}, replacement interface{}, ...) (*mongo.UpdateResult, error)
- func (m *MockMongoCollection) UpdateMany(ctx context.Context, filter interface{}, update interface{}, ...) (*mongo.UpdateResult, error)
- func (m *MockMongoCollection) UpdateOne(ctx context.Context, filter interface{}, update interface{}, ...) (*mongo.UpdateResult, error)
- func (m *MockMongoCollection) Watch(ctx context.Context, pipeline interface{}, ...) (*mongo.ChangeStream, error)
- func (m *MockMongoCollection) WriteConcern() *writeconcern.WriteConcern
- type MockMongoCursor
- func (m *MockMongoCursor) All(ctx context.Context, results interface{}) error
- func (m *MockMongoCursor) BatchSize() int32
- func (m *MockMongoCursor) Close(ctx context.Context) error
- func (m *MockMongoCursor) Decode(v interface{}) error
- func (m *MockMongoCursor) DecodeBytes() (bson.Raw, error)
- func (m *MockMongoCursor) Err() error
- func (m *MockMongoCursor) ID() int64
- func (m *MockMongoCursor) Next(ctx context.Context) bool
- func (m *MockMongoCursor) RemainingBatchLength() int
- func (m *MockMongoCursor) SetAllowDiskUse(bool) *mongo.Cursor
- func (m *MockMongoCursor) SetAllowDiskUseFromCursor(cursor *mongo.Cursor) *mongo.Cursor
- func (m *MockMongoCursor) SetAllowPartialResults(bool) *mongo.Cursor
- func (m *MockMongoCursor) SetAllowPartialResultsFromCursor(cursor *mongo.Cursor) *mongo.Cursor
- func (m *MockMongoCursor) SetBatchSize(size int32) *mongo.Cursor
- func (m *MockMongoCursor) SetBatchSizeFromCursor(cursor *mongo.Cursor) *mongo.Cursor
- func (m *MockMongoCursor) SetComment(comment interface{}) *mongo.Cursor
- func (m *MockMongoCursor) SetCursorType(ct int) *mongo.Cursor
- func (m *MockMongoCursor) SetHint(hint interface{}) *mongo.Cursor
- func (m *MockMongoCursor) SetLimit(limit int64) *mongo.Cursor
- func (m *MockMongoCursor) SetMax(bson.Raw) *mongo.Cursor
- func (m *MockMongoCursor) SetMaxAwaitTime(d time.Duration) *mongo.Cursor
- func (m *MockMongoCursor) SetMaxFromCursor(cursor *mongo.Cursor) *mongo.Cursor
- func (m *MockMongoCursor) SetMaxTime(d time.Duration) *mongo.Cursor
- func (m *MockMongoCursor) SetMaxTimeFromCursor(cursor *mongo.Cursor) *mongo.Cursor
- func (m *MockMongoCursor) SetMin(bson.Raw) *mongo.Cursor
- func (m *MockMongoCursor) SetMinFromCursor(cursor *mongo.Cursor) *mongo.Cursor
- func (m *MockMongoCursor) SetNoCursorTimeout(bool) *mongo.Cursor
- func (m *MockMongoCursor) SetNoCursorTimeoutFromCursor(cursor *mongo.Cursor) *mongo.Cursor
- func (m *MockMongoCursor) SetOplogReplay(bool) *mongo.Cursor
- func (m *MockMongoCursor) SetOplogReplayFromCursor(cursor *mongo.Cursor) *mongo.Cursor
- func (m *MockMongoCursor) SetPartial(bool) *mongo.Cursor
- func (m *MockMongoCursor) SetPartialFromCursor(cursor *mongo.Cursor) *mongo.Cursor
- func (m *MockMongoCursor) SetReturnKey(bool) *mongo.Cursor
- func (m *MockMongoCursor) SetReturnKeyFromCursor(cursor *mongo.Cursor) *mongo.Cursor
- func (m *MockMongoCursor) SetShowRecordID(bool) *mongo.Cursor
- func (m *MockMongoCursor) SetShowRecordIDFromCursor(cursor *mongo.Cursor) *mongo.Cursor
- func (m *MockMongoCursor) SetSnapshot(bool) *mongo.Cursor
- func (m *MockMongoCursor) SetSnapshotFromCursor(cursor *mongo.Cursor) *mongo.Cursor
- func (m *MockMongoCursor) SetSort(interface{}) *mongo.Cursor
- func (m *MockMongoCursor) SetSortFromCursor(cursor *mongo.Cursor) *mongo.Cursor
- func (m *MockMongoCursor) SetTailable(bool) *mongo.Cursor
- func (m *MockMongoCursor) SetTailableFromCursor(cursor *mongo.Cursor) *mongo.Cursor
- func (m *MockMongoCursor) TryNext(ctx context.Context) bool
- type MockMongoDatabase
- func (m *MockMongoDatabase) Aggregate(ctx context.Context, pipeline interface{}, opts ...*options.AggregateOptions) (*mongo.Cursor, error)
- func (m *MockMongoDatabase) Client() *mongo.Client
- func (m *MockMongoDatabase) Collection(name string, opts ...*options.CollectionOptions) *mongo.Collection
- func (m *MockMongoDatabase) Drop(ctx context.Context) error
- func (m *MockMongoDatabase) ListCollectionNames(ctx context.Context, filter interface{}, ...) ([]string, error)
- func (m *MockMongoDatabase) ListCollections(ctx context.Context, filter interface{}, ...) (*mongo.Cursor, error)
- func (m *MockMongoDatabase) Name() string
- func (m *MockMongoDatabase) ReadConcern() *readconcern.ReadConcern
- func (m *MockMongoDatabase) ReadPreference() *readpref.ReadPref
- func (m *MockMongoDatabase) RunCommand(ctx context.Context, runCommand interface{}, opts ...*options.RunCmdOptions) *mongo.SingleResult
- func (m *MockMongoDatabase) RunCommandCursor(ctx context.Context, runCommand interface{}, opts ...*options.RunCmdOptions) (*mongo.Cursor, error)
- func (m *MockMongoDatabase) WriteConcern() *writeconcern.WriteConcern
- type MockMongoSingleResult
- type MockRedisBoolCmd
- type MockRedisClient
- func (m *MockRedisClient) AddHook(hook redis.Hook)
- func (m *MockRedisClient) Append(ctx context.Context, key, value string) *redis.IntCmd
- func (m *MockRedisClient) BitCount(ctx context.Context, key string, bitCount *redis.BitCount) *redis.IntCmd
- func (m *MockRedisClient) BitOpAnd(ctx context.Context, destKey string, keys ...string) *redis.IntCmd
- func (m *MockRedisClient) BitOpNot(ctx context.Context, destKey, key string) *redis.IntCmd
- func (m *MockRedisClient) BitOpOr(ctx context.Context, destKey string, keys ...string) *redis.IntCmd
- func (m *MockRedisClient) BitOpXor(ctx context.Context, destKey string, keys ...string) *redis.IntCmd
- func (m *MockRedisClient) BitPos(ctx context.Context, key string, bit int64, pos ...int64) *redis.IntCmd
- func (m *MockRedisClient) ClientGetName(ctx context.Context) *redis.StringCmd
- func (m *MockRedisClient) Close() error
- func (m *MockRedisClient) Decr(ctx context.Context, key string) *redis.IntCmd
- func (m *MockRedisClient) DecrBy(ctx context.Context, key string, decrement int64) *redis.IntCmd
- func (m *MockRedisClient) Del(ctx context.Context, keys ...string) *redis.IntCmd
- func (m *MockRedisClient) Do(ctx context.Context, args ...interface{}) *redis.Cmd
- func (m *MockRedisClient) Dump(ctx context.Context, key string) *redis.StringCmd
- func (m *MockRedisClient) Echo(ctx context.Context, message interface{}) *redis.StringCmd
- func (m *MockRedisClient) Exists(ctx context.Context, keys ...string) *redis.IntCmd
- func (m *MockRedisClient) Expire(ctx context.Context, key string, expiration time.Duration) *redis.BoolCmd
- func (m *MockRedisClient) ExpireAt(ctx context.Context, key string, tm time.Time) *redis.BoolCmd
- func (m *MockRedisClient) Get(ctx context.Context, key string) *redis.StringCmd
- func (m *MockRedisClient) GetBit(ctx context.Context, key string, offset int64) *redis.IntCmd
- func (m *MockRedisClient) GetRange(ctx context.Context, key string, start, end int64) *redis.StringCmd
- func (m *MockRedisClient) GetSet(ctx context.Context, key string, value interface{}) *redis.StringCmd
- func (m *MockRedisClient) HScan(ctx context.Context, key string, cursor uint64, match string, count int64) *redis.ScanCmd
- func (m *MockRedisClient) Incr(ctx context.Context, key string) *redis.IntCmd
- func (m *MockRedisClient) IncrBy(ctx context.Context, key string, value int64) *redis.IntCmd
- func (m *MockRedisClient) IncrByFloat(ctx context.Context, key string, value float64) *redis.FloatCmd
- func (m *MockRedisClient) Keys(ctx context.Context, pattern string) *redis.StringSliceCmd
- func (m *MockRedisClient) MGet(ctx context.Context, keys ...string) *redis.SliceCmd
- func (m *MockRedisClient) MSet(ctx context.Context, values ...interface{}) *redis.StatusCmd
- func (m *MockRedisClient) MSetNX(ctx context.Context, values ...interface{}) *redis.BoolCmd
- func (m *MockRedisClient) Migrate(ctx context.Context, host, port, key string, db int, timeout time.Duration) *redis.StatusCmd
- func (m *MockRedisClient) Move(ctx context.Context, key string, db int) *redis.BoolCmd
- func (m *MockRedisClient) ObjectEncoding(ctx context.Context, key string) *redis.StringCmd
- func (m *MockRedisClient) ObjectIdleTime(ctx context.Context, key string) *redis.DurationCmd
- func (m *MockRedisClient) ObjectRefCount(ctx context.Context, key string) *redis.IntCmd
- func (m *MockRedisClient) PExpire(ctx context.Context, key string, expiration time.Duration) *redis.BoolCmd
- func (m *MockRedisClient) PExpireAt(ctx context.Context, key string, tm time.Time) *redis.BoolCmd
- func (m *MockRedisClient) PSubscribe(ctx context.Context, channels ...string) *redis.PubSub
- func (m *MockRedisClient) PTTL(ctx context.Context, key string) *redis.DurationCmd
- func (m *MockRedisClient) Persist(ctx context.Context, key string) *redis.BoolCmd
- func (m *MockRedisClient) Ping(ctx context.Context) *redis.StatusCmd
- func (m *MockRedisClient) Pipeline() redis.Pipeliner
- func (m *MockRedisClient) Pipelined(ctx context.Context, fn func(redis.Pipeliner) error) ([]redis.Cmder, error)
- func (m *MockRedisClient) PoolStats() *redis.PoolStats
- func (m *MockRedisClient) Process(ctx context.Context, cmd redis.Cmder) error
- func (m *MockRedisClient) ProcessMulti(ctx context.Context, cmds []redis.Cmder) error
- func (m *MockRedisClient) ProcessPipeline(ctx context.Context, cmds []redis.Cmder) error
- func (m *MockRedisClient) Quit(ctx context.Context) *redis.StatusCmd
- func (m *MockRedisClient) RandomKey(ctx context.Context) *redis.StringCmd
- func (m *MockRedisClient) Rename(ctx context.Context, key, newkey string) *redis.StatusCmd
- func (m *MockRedisClient) RenameNX(ctx context.Context, key, newkey string) *redis.BoolCmd
- func (m *MockRedisClient) Restore(ctx context.Context, key string, ttl time.Duration, value string) *redis.StatusCmd
- func (m *MockRedisClient) RestoreReplace(ctx context.Context, key string, ttl time.Duration, value string) *redis.StatusCmd
- func (m *MockRedisClient) SScan(ctx context.Context, key string, cursor uint64, match string, count int64) *redis.ScanCmd
- func (m *MockRedisClient) SSubscribe(ctx context.Context, channels ...string) *redis.PubSub
- func (m *MockRedisClient) Scan(ctx context.Context, cursor uint64, match string, count int64) *redis.ScanCmd
- func (m *MockRedisClient) Set(ctx context.Context, key string, value interface{}, expiration time.Duration) *redis.StatusCmd
- func (m *MockRedisClient) SetBit(ctx context.Context, key string, offset int64, value int) *redis.IntCmd
- func (m *MockRedisClient) SetRange(ctx context.Context, key string, offset int64, value string) *redis.IntCmd
- func (m *MockRedisClient) Sort(ctx context.Context, key string, sort *redis.Sort) *redis.StringSliceCmd
- func (m *MockRedisClient) SortInterfaces(ctx context.Context, key string, sort *redis.Sort) *redis.SliceCmd
- func (m *MockRedisClient) SortStore(ctx context.Context, key, store string, sort *redis.Sort) *redis.IntCmd
- func (m *MockRedisClient) StrLen(ctx context.Context, key string) *redis.IntCmd
- func (m *MockRedisClient) Subscribe(ctx context.Context, channels ...string) *redis.PubSub
- func (m *MockRedisClient) TTL(ctx context.Context, key string) *redis.DurationCmd
- func (m *MockRedisClient) Touch(ctx context.Context, keys ...string) *redis.IntCmd
- func (m *MockRedisClient) TxPipeline() redis.Pipeliner
- func (m *MockRedisClient) TxPipelined(ctx context.Context, fn func(redis.Pipeliner) error) ([]redis.Cmder, error)
- func (m *MockRedisClient) Type(ctx context.Context, key string) *redis.StatusCmd
- func (m *MockRedisClient) Unlink(ctx context.Context, keys ...string) *redis.IntCmd
- func (m *MockRedisClient) Watch(ctx context.Context, fn func(*redis.Tx) error, keys ...string) error
- func (m *MockRedisClient) ZScan(ctx context.Context, key string, cursor uint64, match string, count int64) *redis.ScanCmd
- type MockRedisCmd
- func (m *MockRedisCmd) Args() []interface{}
- func (m *MockRedisCmd) Err() error
- func (m *MockRedisCmd) FullName() string
- func (m *MockRedisCmd) Name() string
- func (m *MockRedisCmd) SetFirstKeyPos(keyPos int8)
- func (m *MockRedisCmd) SetReadTimeout(timeout time.Duration)
- func (m *MockRedisCmd) SetWriteTimeout(timeout time.Duration)
- func (m *MockRedisCmd) String() string
- func (m *MockRedisCmd) Val() interface{}
- type MockRedisDurationCmd
- type MockRedisFloatCmd
- type MockRedisIntCmd
- type MockRedisPipeliner
- func (m *MockRedisPipeliner) AddHook(hook redis.Hook)
- func (m *MockRedisPipeliner) Close() error
- func (m *MockRedisPipeliner) Discard() error
- func (m *MockRedisPipeliner) Do(ctx context.Context, args ...interface{}) *redis.Cmd
- func (m *MockRedisPipeliner) Exec(ctx context.Context) ([]redis.Cmder, error)
- func (m *MockRedisPipeliner) ExecVal(ctx context.Context, fn func(redis.Pipeliner) error) ([]redis.Cmder, error)
- func (m *MockRedisPipeliner) Len() int
- func (m *MockRedisPipeliner) Process(ctx context.Context, cmd redis.Cmder) error
- func (m *MockRedisPipeliner) ProcessMulti(ctx context.Context, cmds []redis.Cmder) error
- func (m *MockRedisPipeliner) ProcessPipeline(ctx context.Context, cmds []redis.Cmder) error
- func (m *MockRedisPipeliner) SetErr(e error)
- func (m *MockRedisPipeliner) SetVal(val interface{})
- type MockRedisPubSub
- func (m *MockRedisPubSub) Channel() <-chan *redis.Message
- func (m *MockRedisPubSub) ChannelSize(size int) <-chan *redis.Message
- func (m *MockRedisPubSub) ChannelWithSubscriptions(ctx context.Context, bufferSize int) <-chan interface{}
- func (m *MockRedisPubSub) Close() error
- func (m *MockRedisPubSub) PSubscribe(ctx context.Context, channels ...string) error
- func (m *MockRedisPubSub) PUnsubscribe(ctx context.Context, channels ...string) error
- func (m *MockRedisPubSub) Ping(ctx context.Context, payload string) error
- func (m *MockRedisPubSub) Receive(ctx context.Context) (interface{}, error)
- func (m *MockRedisPubSub) ReceiveMessage(ctx context.Context) (*redis.Message, error)
- func (m *MockRedisPubSub) ReceiveTimeout(ctx context.Context, timeout time.Duration) (interface{}, error)
- func (m *MockRedisPubSub) SSubscribe(ctx context.Context, channels ...string) error
- func (m *MockRedisPubSub) SUnsubscribe(ctx context.Context, channels ...string) error
- func (m *MockRedisPubSub) SetErr(e error)
- func (m *MockRedisPubSub) SetVal(val interface{})
- func (m *MockRedisPubSub) String() string
- func (m *MockRedisPubSub) Subscribe(ctx context.Context, channels ...string) error
- func (m *MockRedisPubSub) Unsubscribe(ctx context.Context, channels ...string) error
- func (m *MockRedisPubSub) WithChannelSize(size int) *redis.PubSub
- func (m *MockRedisPubSub) WithChannels(channels ...string) *redis.PubSub
- type MockRedisScanCmd
- type MockRedisSliceCmd
- type MockRedisStatusCmd
- type MockRedisStringCmd
- type MockRedisStringSliceCmd
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 ¶
MockDB is a mock implementation of the DB interface
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) 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 (*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
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 (*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) 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
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 (m *MockMongoCollection) BulkWrite(ctx context.Context, models []mongo.WriteModel, opts ...*options.BulkWriteOptions) (*mongo.BulkWriteResult, error)
func (*MockMongoCollection) Clone ¶ added in v0.7.0
func (m *MockMongoCollection) Clone(opts ...*options.CollectionOptions) (*mongo.Collection, error)
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 (m *MockMongoCollection) Drop(ctx context.Context) error
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
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
type MockMongoDatabase ¶ added in v0.7.0
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
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
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) 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) Do ¶ added in v0.7.0
func (m *MockRedisClient) Do(ctx context.Context, args ...interface{}) *redis.Cmd
func (*MockRedisClient) Echo ¶ added in v0.7.0
func (m *MockRedisClient) Echo(ctx context.Context, message interface{}) *redis.StringCmd
func (*MockRedisClient) IncrByFloat ¶ added in v0.7.0
func (*MockRedisClient) Keys ¶ added in v0.7.0
func (m *MockRedisClient) Keys(ctx context.Context, pattern string) *redis.StringSliceCmd
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) ObjectEncoding ¶ added in v0.7.0
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 (*MockRedisClient) PSubscribe ¶ added in v0.7.0
func (*MockRedisClient) PTTL ¶ added in v0.7.0
func (m *MockRedisClient) PTTL(ctx context.Context, key string) *redis.DurationCmd
func (*MockRedisClient) Ping ¶ added in v0.7.0
func (m *MockRedisClient) Ping(ctx context.Context) *redis.StatusCmd
func (*MockRedisClient) Pipeline ¶ added in v0.7.0
func (m *MockRedisClient) Pipeline() redis.Pipeliner
func (*MockRedisClient) PoolStats ¶ added in v0.7.0
func (m *MockRedisClient) PoolStats() *redis.PoolStats
func (*MockRedisClient) ProcessMulti ¶ added in v0.7.0
func (*MockRedisClient) ProcessPipeline ¶ added in v0.7.0
func (*MockRedisClient) Quit ¶ added in v0.7.0
func (m *MockRedisClient) Quit(ctx context.Context) *redis.StatusCmd
func (*MockRedisClient) RandomKey ¶ added in v0.7.0
func (m *MockRedisClient) RandomKey(ctx context.Context) *redis.StringCmd
func (*MockRedisClient) RestoreReplace ¶ added in v0.7.0
func (*MockRedisClient) SSubscribe ¶ added in v0.7.0
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 (*MockRedisClient) TTL ¶ added in v0.7.0
func (m *MockRedisClient) TTL(ctx context.Context, key string) *redis.DurationCmd
func (*MockRedisClient) TxPipeline ¶ added in v0.7.0
func (m *MockRedisClient) TxPipeline() redis.Pipeliner
func (*MockRedisClient) TxPipelined ¶ added in v0.7.0
type MockRedisCmd ¶ added in v0.7.0
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
func (m *MockRedisDurationCmd) Val() time.Duration
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
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) Len ¶ added in v0.7.0
func (m *MockRedisPipeliner) Len() int
func (*MockRedisPipeliner) ProcessMulti ¶ added in v0.7.0
func (*MockRedisPipeliner) ProcessPipeline ¶ added in v0.7.0
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
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 (*MockRedisPubSub) ReceiveTimeout ¶ added in v0.7.0
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