cache

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2025 License: Apache-2.0 Imports: 5 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缓存实现

func NewRedisCache

func NewRedisCache(client *redis.Client) *RedisCache

NewRedisCache 创建Redis缓存实例

func (*RedisCache) Delete

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

Delete 删除缓存

func (*RedisCache) DeletePattern

func (r *RedisCache) DeletePattern(ctx context.Context, pattern string) error

DeletePattern 按模式删除缓存

func (*RedisCache) Exists

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

Exists 检查键是否存在

func (*RedisCache) Get

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

Get 获取缓存

func (*RedisCache) Set

func (r *RedisCache) 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