redis

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: MIT Imports: 5 Imported by: 0

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