redis_cache

package
v0.0.0-...-50d7d3f Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewRedisCache

func NewRedisCache(redis *redis.Client) *redisCache.Cache

func NewRedisCacheCreateFunc

func NewRedisCacheCreateFunc(prefix string, ttl time.Duration) func(c *redis.Client) *Redis

Types

type Redis

type Redis struct {
	Client *redis.Client
	Cache  *redisCache.Cache
	Prefix string
	Ttl    time.Duration
}

func NewRedis

func NewRedis(c *redis.Client, prefix string, ttl time.Duration) *Redis

func (*Redis) Delete

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

func (*Redis) Get

func (r *Redis) Get(ctx context.Context, key string, obj interface{}) error

func (*Redis) HExpire

func (r *Redis) HExpire(ctx context.Context, key string) error

func (*Redis) HGet

func (r *Redis) HGet(ctx context.Context, key string, field string) (string, error)

func (*Redis) HGetAll

func (r *Redis) HGetAll(ctx context.Context, key string) (map[string]string, error)

func (*Redis) HSet

func (r *Redis) HSet(ctx context.Context, key string, field string, obj interface{}) error

func (*Redis) MGet

func (r *Redis) MGet(ctx context.Context, keys ...string) ([]interface{}, error)

func (*Redis) MSet

func (r *Redis) MSet(ctx context.Context, obj ...interface{}) error

func (*Redis) ScanD

func (r *Redis) ScanD(ctx context.Context, match string) error

func (*Redis) Set

func (r *Redis) Set(ctx context.Context, key string, obj interface{}) error

Jump to

Keyboard shortcuts

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