cache

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2024 License: Apache-2.0 Imports: 7 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 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 NewUserECache

func NewUserECache(c ecache.Cache) UserCache

NewUserECache 注意缓存前缀

type UserECache

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

func (*UserECache) Delete

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

func (*UserECache) Get

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

func (*UserECache) Set

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

Directories

Path Synopsis
Code generated by MockGen.
Code generated by MockGen.

Jump to

Keyboard shortcuts

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