cache

package
v1.18.6 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RedisCache

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

RedisCache redis implement interfaces.Cache

func NewRedisCache

func NewRedisCache(read, write *redis.Pool) *RedisCache

NewRedisCache constructor

func (*RedisCache) Delete

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

Delete method with pattern

func (*RedisCache) DoCommand added in v1.18.4

func (r *RedisCache) DoCommand(ctx context.Context, isWrite bool, command string, args ...any) (reply any, err error)

DoCommand method to execute any Redis command

func (RedisCache) Exists

func (r RedisCache) Exists(ctx context.Context, key string) (exist bool, err error)

Exists method

func (*RedisCache) Get

func (r *RedisCache) Get(ctx context.Context, key string) (data []byte, err error)

Get method

func (*RedisCache) GetKeys

func (r *RedisCache) GetKeys(ctx context.Context, pattern string) (data []string, err error)

GetKeys method

func (*RedisCache) GetTTL added in v1.7.9

func (r *RedisCache) GetTTL(ctx context.Context, key string) (dur time.Duration, err error)

GetTTL method

func (*RedisCache) Set

func (r *RedisCache) Set(ctx context.Context, key string, value any, expire time.Duration) (err error)

Set method

Jump to

Keyboard shortcuts

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