Documentation ¶
Index ¶
- func Delete(c *Cache)
- func GC()
- type Cache
- func (c *Cache) Delete(key interface{})
- func (c *Cache) Each(f func(k, v interface{}) error) (err error)
- func (c *Cache) Exist(key interface{}) (is bool)
- func (c *Cache) Get(key interface{}, f ...func(old interface{}) (v interface{}, t int64)) (v interface{})
- func (c *Cache) Set(key interface{}, data interface{}, t int64)
- func (c *Cache) SetExpire(key interface{}, expire int64) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache 缓存
func (*Cache) Get ¶
func (c *Cache) Get(key interface{}, f ...func(old interface{}) (v interface{}, t int64)) (v interface{})
Get 取缓存数据,如果不存在或过期就用 f() 创建 t: 有效时间,0永不过期,单位秒
Click to show internal directories.
Click to hide internal directories.