Documentation ¶
Overview ¶
Package cache 缓存 异步更新
Index ¶
- type Cache
- func (cache *Cache) SetBlock(is bool)
- func (cache *Cache) SetOnError(errFunc func(err interface{}))
- func (cache *Cache) SetUpdateCond(method func() bool)
- func (cache *Cache) SetUpdateInterval(interval time.Duration)
- func (cache *Cache) SetUpdateMethod(method UpdateMehtod)
- func (cache *Cache) Update()
- func (cache *Cache) Value() interface{}
- type UpdateMehtod
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache 缓存
func (*Cache) SetOnError ¶
func (cache *Cache) SetOnError(errFunc func(err interface{}))
SetOnError 默认false
func (*Cache) SetUpdateCond ¶
SetUpdateCond 设置cache更新的条件. 时间间隔更新失效
func (*Cache) SetUpdateInterval ¶
SetUpdateInterval 设置cache更新的条件. 时间间隔更新. SetUpdateCond会失效. Cond也能完成所有更新方式
func (*Cache) SetUpdateMethod ¶
func (cache *Cache) SetUpdateMethod(method UpdateMehtod)
SetUpdateMethod 设置cache更新方法
Click to show internal directories.
Click to hide internal directories.