redis

package
v0.4.3 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Redis

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

Redis redis cache

func NewCache

func NewCache(rds *redis.Client) *Redis

NewCache 实例化

func (*Redis) Delete

func (r *Redis) Delete(key string) error

Delete 删除

func (*Redis) Get

func (r *Redis) Get(key string, reply interface{}) error

Get 获取一个值

func (*Redis) GetContext added in v0.1.21

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

GetContext 获取一个值

func (*Redis) IsExist

func (r *Redis) IsExist(key string) bool

IsExist 判断key是否存在

func (*Redis) Set

func (r *Redis) Set(key string, val interface{}, timeout time.Duration) (err error)

Set 设置一个值

func (*Redis) SetConn

func (r *Redis) SetConn(conn redis.UniversalClient)

SetConn 设置conn

func (*Redis) SetContext added in v0.1.21

func (r *Redis) SetContext(ctx context.Context)

SetContext 设置redis ctx 参数

Jump to

Keyboard shortcuts

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