Documentation
¶
Index ¶
Constants ¶
View Source
const EmptyCacheExpiration = 5 * time.Second
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseCache ¶
type BaseCache struct {
// contains filtered or unexported fields
}
type Cache ¶
type Cache interface {
Get(k key.Key) (interface{}, error)
GetString(k key.Key) (string, error)
GetBool(k key.Key) (bool, error)
GetTime(k key.Key) (time.Time, error)
Disabled() bool
}
func NewBaseCache ¶
func NewBaseCache(disabled bool, retrieveFunc RetrieveFunc, backend backend.Backend) Cache
type EmptyCache ¶
type EmptyCache struct {
// contains filtered or unexported fields
}
TODO: 内存上可以优化, error相同的话使用同一个对象
type RetrieveFunc ¶
Click to show internal directories.
Click to hide internal directories.