cache

package
v2.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2023 License: MIT Imports: 3 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 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