Documentation ¶ Index ¶ Variables func Cache(keyName string, expiration int, cacheFunc CacheFunc, cacheParameters ...any) any func Clear() func Delete(key string) func InitCacheName(keyName string, cacheParameters ...any) string func Remove(name string) func Set(keyName string, expiration int, data any) type CacheFunc 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 获取变量 不存在则自动设置 func Clear ¶ func Clear() 清空 func Delete ¶ func Delete(key string) 删除指定缓存 func InitCacheName ¶ func InitCacheName(keyName string, cacheParameters ...any) string 组合缓存名称 func Remove ¶ func Remove(name string) 删除 模糊搜索方式 func Set ¶ func Set(keyName string, expiration int, data any) 设置缓存 Types ¶ type CacheFunc ¶ type CacheFunc func(args ...any) (any, error) 缓存数据读取函数 Source Files ¶ View all Source files map.go Click to show internal directories. Click to hide internal directories.