redis

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2025 License: MIT Imports: 5 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	// RedisType represents the storage type as a string value.
	RedisType = "redis"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type RedisStore

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

RedisStore is a store for Redis.

func NewRedis

func NewRedis(client *redis.Client) *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) Del

func (s *RedisStore) Del(ctx context.Context, key any) error

Del removes data from Redis for given key identifier.

func (*RedisStore) Get

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

Get returns data stored from a given key.

func (*RedisStore) GetWithTTL

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

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

func (*RedisStore) Set

func (s *RedisStore) Set(ctx context.Context, key any, value any) error

Set defines data in Redis for given key identifier.

func (*RedisStore) SetWithTTL

func (s *RedisStore) SetWithTTL(ctx context.Context, key any, value any, ttl time.Duration) error

Set defines data in Redis for given key identifier.

func (*RedisStore) Wait

func (s *RedisStore) Wait(ctx context.Context)

Jump to

Keyboard shortcuts

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