cache

package
v0.0.0-...-99221f3 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrKeyNotExist = redis.Nil

ErrKeyNotExist 因为我们目前还是只有一个实现,所以可以保持用别名

Functions

This section is empty.

Types

type RedisUserCache

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

func (*RedisUserCache) Delete

func (cache *RedisUserCache) Delete(ctx context.Context, id int64) error

func (*RedisUserCache) Get

func (cache *RedisUserCache) Get(ctx context.Context, id int64) (domain.User, error)

func (*RedisUserCache) Set

func (cache *RedisUserCache) Set(ctx context.Context, u domain.User) error

type UserCache

type UserCache interface {
	Delete(ctx context.Context, id int64) error
	Get(ctx context.Context, id int64) (domain.User, error)
	Set(ctx context.Context, u domain.User) error
}

func NewRedisUserCache

func NewRedisUserCache(cmd redis.Cmdable) UserCache

Jump to

Keyboard shortcuts

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