redis

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 21, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RedisClientInterface

type RedisClientInterface interface {
	Get(ctx context.Context, key string) *redis.StringCmd
	Set(ctx context.Context, key string, value interface{}, expiration time.Duration) *redis.StatusCmd
	Del(ctx context.Context, keys ...string) *redis.IntCmd
	Keys(ctx context.Context, pattern string) *redis.StringSliceCmd
	Pipeline() redis.Pipeliner
	Ping(ctx context.Context) *redis.StatusCmd
	Close() error
}

RedisClientInterface defines the Redis operations we need

type RedisStore

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

RedisStore implements the Store interface using Redis as the backend

func NewStore

func NewStore(config *config.RedisConfig) (*RedisStore, error)

NewRedisStore creates a new Redis store with the given configuration

func (*RedisStore) Close

func (r *RedisStore) Close() error

Close cleanly shuts down the store

func (*RedisStore) Delete

func (r *RedisStore) Delete(ctx context.Context, key string) error

Delete removes a feature flag

func (*RedisStore) Get

func (r *RedisStore) Get(ctx context.Context, key string) (*core.FeatureFlag, error)

Get retrieves a feature flag by key

func (*RedisStore) GetAll

func (r *RedisStore) GetAll(ctx context.Context) ([]core.FeatureFlag, error)

GetAll retrieves all feature flags

func (*RedisStore) HealthCheck

func (r *RedisStore) HealthCheck(ctx context.Context) error

HealthCheck verifies store connectivity

func (*RedisStore) Set

func (r *RedisStore) Set(ctx context.Context, flag core.FeatureFlag) error

Set creates or updates a feature flag

Jump to

Keyboard shortcuts

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