cache

package
v0.0.0-...-30be18a Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2022 License: Unlicense Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GlobalCacheData *cache
View Source
var GlobalCacheOnce sync.Once

Functions

func ChanLongTime

func ChanLongTime()

ChanLongTime 清理过期的缓存

func Del

func Del(name string) bool

Del 删除

func Exists

func Exists(name string) bool

Exists 判断数据是否存在

func Get

func Get(name string) interface{}

Get 获取缓存数据

func GetTime

func GetTime(name string) int64

GetTime 获取缓存时间

func Set

func Set(name string, data interface{}, second int64) bool

Set 新增缓存,时间=0表示长期存储,无论有没有数据都直接赋值

func SetCover

func SetCover(name string, data interface{}, second int64) bool

SetCover Set 新增缓存,时间=0表示长期存储,如果数据存在则不会进行覆盖,并返回false

func SetDataCover

func SetDataCover(name string, data interface{}) bool

SetDataCover 重置缓存数据

func SetTimeCover

func SetTimeCover(name string, second int64) bool

SetTimeCover 重置缓存时间

func SetTimeDecrease

func SetTimeDecrease(name string, second int64) bool

SetTimeDecrease 减少缓存时间

func SetTimeIncrease

func SetTimeIncrease(name string, second int64) bool

SetTimeIncrease 增加缓存时间

Types

This section is empty.

Jump to

Keyboard shortcuts

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