Documentation ¶
Index ¶
- Constants
- type Cache
- type KVCache
- type MemoryCache
- type MemoryKVCache
- func (right *MemoryKVCache) ClearAll()
- func (right *MemoryKVCache) Fetch(key string) (interface{}, bool)
- func (right *MemoryKVCache) GetAll() (ret []string)
- func (right *MemoryKVCache) Put(key string, data interface{}, maxAge float64) string
- func (right *MemoryKVCache) Release()
- func (right *MemoryKVCache) Remove(key string)
Constants ¶
View Source
const MaxAgeValue = -1
MaxAgeValue 最大存放期限,无限期
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{}, bool) Remove(id string) ClearAll() Release() }
Cache 缓存对象
type KVCache ¶
type KVCache interface { // maxAge单位minute Put(key string, data interface{}, maxAge float64) string Fetch(key string) (interface{}, bool) Remove(key string) GetAll() []string ClearAll() Release() }
KVCache 缓存对象
type MemoryCache ¶
type MemoryCache chan commandData
MemoryCache 内存缓存
func (*MemoryCache) Fetch ¶
func (right *MemoryCache) Fetch(id string) (interface{}, bool)
Fetch 获取数据
func (*MemoryCache) Put ¶
func (right *MemoryCache) Put(data interface{}, maxAge float64) string
Put 投放数据,返回数据的唯一标示
type MemoryKVCache ¶
type MemoryKVCache chan commandData
MemoryKVCache 内存缓存
func (*MemoryKVCache) Fetch ¶
func (right *MemoryKVCache) Fetch(key string) (interface{}, bool)
Fetch 获取数据
Click to show internal directories.
Click to hide internal directories.