rdb

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrement

func Decrement(ctx context.Context, key string, decrement int64) (int64, error)

Decrement decreases the integer value of a key by the given decrement. If the key does not exist, it is set to 0 before performing the operation.

func Flush

func Flush(ctx context.Context) error

func Forever

func Forever(ctx context.Context, key string, value interface{}) error

Forever sets the value of a key without an expiration time.

func Forget

func Forget(ctx context.Context, key string) error

Forget deletes the key-value pair from Redis.

func Get

func Get(ctx context.Context, key string) (string, error)

Get retrieves the value of a key from Redis.

func GetRedisClient

func GetRedisClient() *redis.Client

func Increment

func Increment(ctx context.Context, key string, increment int64) (int64, error)

Increment increases the integer value of a key by the given increment. If the key does not exist, it is set to 0 before performing the operation.

func InitRedisClient

func InitRedisClient(redisConfig config.Redis) error

func Pull

func Pull(ctx context.Context, key string) (string, error)

Pull retrieves the value of a key from Redis and then deletes the key-value pair.

func Remember

func Remember(ctx context.Context, key string, duration time.Duration, fetchFunc func() ([]byte, error)) ([]byte, error)

func RememberForever

func RememberForever(ctx context.Context, key string, fetchFunc func() ([]byte, error)) ([]byte, error)

func Set

func Set(ctx context.Context, key string, value interface{}, expiration time.Duration) error

Set sets a key-value pair with an expiration time.

Types

This section is empty.

Jump to

Keyboard shortcuts

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