Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var RedisModule = fx.Module("liquor-redis-module", fx.Provide(NewRedisClient))
Functions ¶
This section is empty.
Types ¶
type RedisClient ¶
type RedisClient interface { Set(ctx context.Context, key string, value interface{}, expiration time.Duration) error Get(ctx context.Context, key string) (string, error) Delete(ctx context.Context, keys ...string) error Exists(ctx context.Context, keys ...string) (bool, error) Expire(ctx context.Context, key string, expiration time.Duration) (bool, error) Incr(ctx context.Context, key string) (int64, error) HSet(ctx context.Context, key string, values ...interface{}) error HGet(ctx context.Context, key, field string) (string, error) HGetAll(ctx context.Context, key string) (map[string]string, error) HDel(ctx context.Context, key string, fields ...string) error LPush(ctx context.Context, key string, values ...interface{}) error LPop(ctx context.Context, key string) (string, error) RPush(ctx context.Context, key string, values ...interface{}) error RPop(ctx context.Context, key string) (string, error) }
RedisClient defines the interface for Redis operations
func NewInMemoryRedis ¶
func NewInMemoryRedis() RedisClient
NewInMemoryRedis creates a new in-memory implementation of RedisClient
func NewRedisClient ¶
func NewRedisClient(cfg *config.Config) RedisClient
NewRedisClient creates a new Redis client using the provided configuration.
Parameters:
- cfg: Configuration object containing Redis connection details
Returns:
- RedisClient: Interface for Redis operations
Click to show internal directories.
Click to hide internal directories.