Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrNotFound = errors.New("cache: key not found")
ErrNotFound 表示缓存键不存在或已经过期。
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store interface {
Get(context.Context, string) ([]byte, error)
// GetDel 原子读取并删除缓存值。
GetDel(context.Context, string) ([]byte, error)
Set(context.Context, string, []byte, time.Duration) error
SetNX(context.Context, string, []byte, time.Duration) (bool, error)
Delete(context.Context, string) error
Has(context.Context, string) (bool, error)
GetMulti(context.Context, []string) ([][]byte, error)
SetMulti(context.Context, []Item) error
Close() error
}
Store 定义面向字节值的现代缓存接口。
Click to show internal directories.
Click to hide internal directories.