mapDetailCache

package
v1.9.5 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var MapCacher sync.Map
View Source
var MapCacherExpiration sync.Map

Functions

func Cache

func Cache(keyName string, expiration int, cacheFunc CacheFunc, cacheParameters ...any) (any, error)

获取变量 不存在则自动设置

func Clear

func Clear()

清空

func Delete

func Delete(key string)

删除指定缓存

func InitCacheName

func InitCacheName(keyName string, cacheParameters ...any) string

组合缓存名称

func Set

func Set(keyName string, expiration int, data any)

设置缓存

func Start

func Start(GCIntervalTime int64)

初始化

Types

type CacheFunc

type CacheFunc func(args ...any) (any, error)

缓存数据读取函数

Jump to

Keyboard shortcuts

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