Documentation ¶
Overview ¶
Package mocks is a generated GoMock package.
Index ¶
- Constants
- type MockRedisClientInterface
- func (m *MockRedisClientInterface) Del(ctx context.Context, keys ...string) *redis.IntCmd
- func (m *MockRedisClientInterface) EXPECT() *MockRedisClientInterfaceMockRecorder
- func (m *MockRedisClientInterface) Expire(ctx context.Context, key string, expiration time.Duration) *redis.BoolCmd
- func (m *MockRedisClientInterface) FlushAll(ctx context.Context) *redis.StatusCmd
- func (m *MockRedisClientInterface) Get(ctx context.Context, key string) *redis.StringCmd
- func (m *MockRedisClientInterface) SAdd(ctx context.Context, key string, members ...any) *redis.IntCmd
- func (m *MockRedisClientInterface) SMembers(ctx context.Context, key string) *redis.StringSliceCmd
- func (m *MockRedisClientInterface) Set(ctx context.Context, key string, values any, expiration time.Duration) *redis.StatusCmd
- func (m *MockRedisClientInterface) TTL(ctx context.Context, key string) *redis.DurationCmd
- type MockRedisClientInterfaceMockRecorder
- func (mr *MockRedisClientInterfaceMockRecorder) Del(ctx interface{}, keys ...interface{}) *gomock.Call
- func (mr *MockRedisClientInterfaceMockRecorder) Expire(ctx, key, expiration interface{}) *gomock.Call
- func (mr *MockRedisClientInterfaceMockRecorder) FlushAll(ctx interface{}) *gomock.Call
- func (mr *MockRedisClientInterfaceMockRecorder) Get(ctx, key interface{}) *gomock.Call
- func (mr *MockRedisClientInterfaceMockRecorder) SAdd(ctx, key interface{}, members ...interface{}) *gomock.Call
- func (mr *MockRedisClientInterfaceMockRecorder) SMembers(ctx, key interface{}) *gomock.Call
- func (mr *MockRedisClientInterfaceMockRecorder) Set(ctx, key, values, expiration interface{}) *gomock.Call
- func (mr *MockRedisClientInterfaceMockRecorder) TTL(ctx, key interface{}) *gomock.Call
- type RedisClientInterface
- type RedisStore
- func (s *RedisStore) Clear(ctx context.Context) error
- func (s *RedisStore) Delete(ctx context.Context, key any) error
- func (s *RedisStore) Get(ctx context.Context, key any) (any, error)
- func (s *RedisStore) GetType() string
- func (s *RedisStore) GetWithTTL(ctx context.Context, key any) (any, time.Duration, error)
- func (s *RedisStore) Invalidate(ctx context.Context, options ...lib_store.InvalidateOption) error
- func (s *RedisStore) Set(ctx context.Context, key any, value any, options ...lib_store.Option) error
Constants ¶
const ( // RedisType represents the storage type as a string value RedisType = "redis" // RedisTagPattern represents the tag pattern to be used as a key in specified storage RedisTagPattern = "gocache_tag_%s" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockRedisClientInterface ¶
type MockRedisClientInterface struct {
// contains filtered or unexported fields
}
MockRedisClientInterface is a mock of RedisClientInterface interface.
func NewMockRedisClientInterface ¶
func NewMockRedisClientInterface(ctrl *gomock.Controller) *MockRedisClientInterface
NewMockRedisClientInterface creates a new mock instance.
func (*MockRedisClientInterface) EXPECT ¶
func (m *MockRedisClientInterface) EXPECT() *MockRedisClientInterfaceMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
func (*MockRedisClientInterface) Expire ¶
func (m *MockRedisClientInterface) Expire(ctx context.Context, key string, expiration time.Duration) *redis.BoolCmd
Expire mocks base method.
func (*MockRedisClientInterface) FlushAll ¶
func (m *MockRedisClientInterface) FlushAll(ctx context.Context) *redis.StatusCmd
FlushAll mocks base method.
func (*MockRedisClientInterface) SAdd ¶
func (m *MockRedisClientInterface) SAdd(ctx context.Context, key string, members ...any) *redis.IntCmd
SAdd mocks base method.
func (*MockRedisClientInterface) SMembers ¶
func (m *MockRedisClientInterface) SMembers(ctx context.Context, key string) *redis.StringSliceCmd
SMembers mocks base method.
func (*MockRedisClientInterface) Set ¶
func (m *MockRedisClientInterface) Set(ctx context.Context, key string, values any, expiration time.Duration) *redis.StatusCmd
Set mocks base method.
func (*MockRedisClientInterface) TTL ¶
func (m *MockRedisClientInterface) TTL(ctx context.Context, key string) *redis.DurationCmd
TTL mocks base method.
type MockRedisClientInterfaceMockRecorder ¶
type MockRedisClientInterfaceMockRecorder struct {
// contains filtered or unexported fields
}
MockRedisClientInterfaceMockRecorder is the mock recorder for MockRedisClientInterface.
func (*MockRedisClientInterfaceMockRecorder) Del ¶
func (mr *MockRedisClientInterfaceMockRecorder) Del(ctx interface{}, keys ...interface{}) *gomock.Call
Del indicates an expected call of Del.
func (*MockRedisClientInterfaceMockRecorder) Expire ¶
func (mr *MockRedisClientInterfaceMockRecorder) Expire(ctx, key, expiration interface{}) *gomock.Call
Expire indicates an expected call of Expire.
func (*MockRedisClientInterfaceMockRecorder) FlushAll ¶
func (mr *MockRedisClientInterfaceMockRecorder) FlushAll(ctx interface{}) *gomock.Call
FlushAll indicates an expected call of FlushAll.
func (*MockRedisClientInterfaceMockRecorder) Get ¶
func (mr *MockRedisClientInterfaceMockRecorder) Get(ctx, key interface{}) *gomock.Call
Get indicates an expected call of Get.
func (*MockRedisClientInterfaceMockRecorder) SAdd ¶
func (mr *MockRedisClientInterfaceMockRecorder) SAdd(ctx, key interface{}, members ...interface{}) *gomock.Call
SAdd indicates an expected call of SAdd.
func (*MockRedisClientInterfaceMockRecorder) SMembers ¶
func (mr *MockRedisClientInterfaceMockRecorder) SMembers(ctx, key interface{}) *gomock.Call
SMembers indicates an expected call of SMembers.
func (*MockRedisClientInterfaceMockRecorder) Set ¶
func (mr *MockRedisClientInterfaceMockRecorder) Set(ctx, key, values, expiration interface{}) *gomock.Call
Set indicates an expected call of Set.
func (*MockRedisClientInterfaceMockRecorder) TTL ¶
func (mr *MockRedisClientInterfaceMockRecorder) TTL(ctx, key interface{}) *gomock.Call
TTL indicates an expected call of TTL.
type RedisClientInterface ¶
type RedisClientInterface interface { Get(ctx context.Context, key string) *redis.StringCmd TTL(ctx context.Context, key string) *redis.DurationCmd Expire(ctx context.Context, key string, expiration time.Duration) *redis.BoolCmd Set(ctx context.Context, key string, values any, expiration time.Duration) *redis.StatusCmd Del(ctx context.Context, keys ...string) *redis.IntCmd FlushAll(ctx context.Context) *redis.StatusCmd SAdd(ctx context.Context, key string, members ...any) *redis.IntCmd SMembers(ctx context.Context, key string) *redis.StringSliceCmd }
RedisClientInterface represents a go-redis/redis client
type RedisStore ¶
type RedisStore struct {
// contains filtered or unexported fields
}
RedisStore is a store for Redis
func NewRedis ¶
func NewRedis(client RedisClientInterface, options ...lib_store.Option) *RedisStore
NewRedis creates a new store to Redis instance(s)
func (*RedisStore) Clear ¶
func (s *RedisStore) Clear(ctx context.Context) error
Clear resets all data in the store
func (*RedisStore) Delete ¶
func (s *RedisStore) Delete(ctx context.Context, key any) error
Delete removes data from Redis for given key identifier
func (*RedisStore) GetWithTTL ¶
GetWithTTL returns data stored from a given key and its corresponding TTL
func (*RedisStore) Invalidate ¶
func (s *RedisStore) Invalidate(ctx context.Context, options ...lib_store.InvalidateOption) error
Invalidate invalidates some cache data in Redis for given options