cache

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2025 License: AGPL-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 RedisClient

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

RedisClient Redis客户端封装

func NewRedisClient

func NewRedisClient(redisURL string) *RedisClient

NewRedisClient 创建Redis客户端

func (*RedisClient) Close

func (r *RedisClient) Close() error

Close 关闭连接

func (*RedisClient) Delete

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

Delete 删除缓存

func (*RedisClient) Exists

func (r *RedisClient) Exists(ctx context.Context, key string) bool

Exists 检查键是否存在

func (*RedisClient) Get

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

Get 获取缓存

func (*RedisClient) Set

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

Set 设置缓存

Jump to

Keyboard shortcuts

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