cache

package
v3.0.3 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Expire

func Expire(key string, expiredTimeDuration time.Duration) bool

Expire 为key设置过期时间

func Forget

func Forget(key string) bool

Forget 根据key删除对应的value值

func Get

func Get(key string) (value interface{}, ret int)

Get 根据key获取对应的value值 ret的表示(0:key存在且未过期,-1:key已过期,-2:key不存在)

func GetListInstance added in v3.0.1

func GetListInstance() *queue.Instance

GetListInstance 获取列表实例

func InitList added in v3.0.1

func InitList()

InitList 初始化列表

func NewList added in v3.0.1

func NewList(listName string) *queue.Instance

NewList 新建列表

func Put

func Put(key string, val interface{}, expiredTimeDuration ...time.Duration) bool

Put 保存key-value键值对

若不设置过期时间,则默认过期时间为一个小时

Types

This section is empty.

Jump to

Keyboard shortcuts

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