Documentation ¶
Index ¶
Constants ¶
View Source
const ( Disabled int64 = -1 Fresh int64 = -2 )
Variables ¶
View Source
var DefaultTTL int64 = 86400 * 10 * 366
Functions ¶
func CreateKey ¶
CreateKey will generate a key based on the input arguments. When prefix is true, the caller's name will be used to prefix the key in an attempt to make it unique. The args can also be separated using sep. visual performs no functionality. It is used at code level to visually see how the key is structured.
func CreateKeyStruct ¶
func CreateKeyStruct(strct interface{}) string
CreateKeyStruct generates a key by converting a struct into a JSON object.
Types ¶
type Cachex ¶
type Cachex struct {
// contains filtered or unexported fields
}
Cachex 缓存处理类
func (*Cachex) UseStaleWhenError ¶
UseStaleWhenError 设置当查询发生错误时,使用过期的缓存数据。该特性需要Storage支持(Get返回过期的缓存数据和Expired错误实现)。默认关闭。
type GetOption ¶
type GetOption struct {
// contains filtered or unexported fields
}
GetOption Get方法的可选参数项结构,不需要直接调用。
func DisableCacheUsage ¶
func UseFreshData ¶
Click to show internal directories.
Click to hide internal directories.