rediscluster

package
v2.3.8 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2024 License: MIT, MIT Imports: 7 Imported by: 0

Documentation

Overview

Package rediscluster is a generated GoMock package.

Index

Constants

View Source
const (
	// RedisType represents the storage type as a string value
	RedisClusterType = "rediscluster"
	// RedisTagPattern represents the tag pattern to be used as a key in specified storage
	RedisClusterTagPattern = "gocache_tag_%s"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type MockRedisClusterClientInterface

type MockRedisClusterClientInterface struct {
	// contains filtered or unexported fields
}

MockRedisClusterClientInterface is a mock of RedisClusterClientInterface interface.

func NewMockRedisClusterClientInterface

func NewMockRedisClusterClientInterface(ctrl *gomock.Controller) *MockRedisClusterClientInterface

NewMockRedisClusterClientInterface creates a new mock instance.

func (*MockRedisClusterClientInterface) Del

Del mocks base method.

func (*MockRedisClusterClientInterface) EXPECT

EXPECT returns an object that allows the caller to indicate expected use.

func (*MockRedisClusterClientInterface) Expire

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

Expire mocks base method.

func (*MockRedisClusterClientInterface) FlushAll

FlushAll mocks base method.

func (*MockRedisClusterClientInterface) Get

Get mocks base method.

func (*MockRedisClusterClientInterface) SAdd

func (m *MockRedisClusterClientInterface) SAdd(ctx context.Context, key string, members ...any) *v9.IntCmd

SAdd mocks base method.

func (*MockRedisClusterClientInterface) SMembers

SMembers mocks base method.

func (*MockRedisClusterClientInterface) Set

func (m *MockRedisClusterClientInterface) Set(ctx context.Context, key string, values any, expiration time.Duration) *v9.StatusCmd

Set mocks base method.

func (*MockRedisClusterClientInterface) TTL

TTL mocks base method.

type MockRedisClusterClientInterfaceMockRecorder

type MockRedisClusterClientInterfaceMockRecorder struct {
	// contains filtered or unexported fields
}

MockRedisClusterClientInterfaceMockRecorder is the mock recorder for MockRedisClusterClientInterface.

func (*MockRedisClusterClientInterfaceMockRecorder) Del

func (mr *MockRedisClusterClientInterfaceMockRecorder) Del(ctx interface{}, keys ...interface{}) *gomock.Call

Del indicates an expected call of Del.

func (*MockRedisClusterClientInterfaceMockRecorder) Expire

func (mr *MockRedisClusterClientInterfaceMockRecorder) Expire(ctx, key, expiration interface{}) *gomock.Call

Expire indicates an expected call of Expire.

func (*MockRedisClusterClientInterfaceMockRecorder) FlushAll

func (mr *MockRedisClusterClientInterfaceMockRecorder) FlushAll(ctx interface{}) *gomock.Call

FlushAll indicates an expected call of FlushAll.

func (*MockRedisClusterClientInterfaceMockRecorder) Get

func (mr *MockRedisClusterClientInterfaceMockRecorder) Get(ctx, key interface{}) *gomock.Call

Get indicates an expected call of Get.

func (*MockRedisClusterClientInterfaceMockRecorder) SAdd

func (mr *MockRedisClusterClientInterfaceMockRecorder) SAdd(ctx, key interface{}, members ...interface{}) *gomock.Call

SAdd indicates an expected call of SAdd.

func (*MockRedisClusterClientInterfaceMockRecorder) SMembers

func (mr *MockRedisClusterClientInterfaceMockRecorder) SMembers(ctx, key interface{}) *gomock.Call

SMembers indicates an expected call of SMembers.

func (*MockRedisClusterClientInterfaceMockRecorder) Set

func (mr *MockRedisClusterClientInterfaceMockRecorder) Set(ctx, key, values, expiration interface{}) *gomock.Call

Set indicates an expected call of Set.

func (*MockRedisClusterClientInterfaceMockRecorder) TTL

func (mr *MockRedisClusterClientInterfaceMockRecorder) TTL(ctx, key interface{}) *gomock.Call

TTL indicates an expected call of TTL.

type RedisClusterClientInterface

type RedisClusterClientInterface 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
}

RedisClusterClientInterface represents a go-redis/redis clusclient

type RedisClusterStore

type RedisClusterStore struct {
	// contains filtered or unexported fields
}

RedisStore is a store for Redis

func NewRedisCluster

func NewRedisCluster(client RedisClusterClientInterface, options ...lib_store.Option) *RedisClusterStore

NewRedis creates a new store to Redis instance(s)

func (*RedisClusterStore) Clear

func (s *RedisClusterStore) Clear(ctx context.Context) error

Clear resets all data in the store

func (*RedisClusterStore) Delete

func (s *RedisClusterStore) Delete(ctx context.Context, key any) error

Delete removes data from Redis for given key identifier

func (*RedisClusterStore) Get

func (s *RedisClusterStore) Get(ctx context.Context, key any) (any, error)

Get returns data stored from a given key

func (*RedisClusterStore) GetType

func (s *RedisClusterStore) GetType() string

GetType returns the store type

func (*RedisClusterStore) GetWithTTL

func (s *RedisClusterStore) GetWithTTL(ctx context.Context, key any) (any, time.Duration, error)

GetWithTTL returns data stored from a given key and its corresponding TTL

func (*RedisClusterStore) Invalidate

func (s *RedisClusterStore) Invalidate(ctx context.Context, options ...lib_store.InvalidateOption) error

Invalidate invalidates some cache data in Redis for given options

func (*RedisClusterStore) Set

func (s *RedisClusterStore) Set(ctx context.Context, key any, value any, options ...lib_store.Option) error

Set defines data in Redis for given key identifier

Jump to

Keyboard shortcuts

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