Documentation ¶
Index ¶
- Constants
- type Cache
- type CleanCallBackFunc
- type KVCache
- type MemoryCache
- type MemoryKVCache
- func (s *MemoryKVCache) ClearAll()
- func (s *MemoryKVCache) Fetch(key string) interface{}
- func (s *MemoryKVCache) GetAll() (ret []interface{})
- func (s *MemoryKVCache) Put(key string, data interface{}, maxAge float64) string
- func (s *MemoryKVCache) Release()
- func (s *MemoryKVCache) Remove(key string)
- func (s *MemoryKVCache) Search(opr SearchOpr) interface{}
- type SearchOpr
Constants ¶
View Source
const ForeverAgeValue = -1
ForeverAgeValue 最大存放期限,无限期
View Source
const HalfHourAgeValue = 30
View Source
const OneMinuteAgeValue = 1
View Source
const TenMinutesAgeValue = 10
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface { // maxAge单位minute Put(data interface{}, maxAge float64) string Fetch(id string) interface{} Search(opr SearchOpr) interface{} Remove(id string) ClearAll() Release() }
Cache 缓存对象
type CleanCallBackFunc ¶ added in v1.3.24
type CleanCallBackFunc func(string)
type KVCache ¶
type KVCache interface { // Put maxAge单位minute Put(key string, data interface{}, maxAge float64) string Fetch(key string) interface{} Search(opr SearchOpr) interface{} Remove(key string) GetAll() []interface{} ClearAll() Release() }
KVCache 缓存对象
type MemoryCache ¶
type MemoryCache chan commandData
MemoryCache 内存缓存
func (*MemoryCache) Put ¶
func (s *MemoryCache) Put(data interface{}, maxAge float64) string
Put 投放数据,返回数据的唯一标示
func (*MemoryCache) Search ¶ added in v1.2.7
func (s *MemoryCache) Search(opr SearchOpr) interface{}
type MemoryKVCache ¶
type MemoryKVCache chan commandData
MemoryKVCache 内存缓存
func (*MemoryKVCache) Put ¶
func (s *MemoryKVCache) Put(key string, data interface{}, maxAge float64) string
Put 投放数据,返回数据的唯一标示
func (*MemoryKVCache) Search ¶ added in v1.2.7
func (s *MemoryKVCache) Search(opr SearchOpr) interface{}
Click to show internal directories.
Click to hide internal directories.