Documentation ¶
Overview ¶
Package cache 缓存 异步更新
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
Cache 缓存
func NewWithBlock ¶ added in v1.0.0
func NewWithBlock(interval time.Duration, u UpdateMehtod) *Cache
New 创建一个Cache对象, 异步更新必须调用Destroy 销毁
func NewWithEvery ¶ added in v1.0.0
func NewWithEvery(u UpdateMehtod) *Cache
NewWithEvery 创建一个Cache对象. 必须每次都触发UpdateMethod可以自定以条件
func (*Cache) SetOnUpdateError ¶ added in v1.0.0
func (cache *Cache) SetOnUpdateError(errFunc func(err interface{}))
SetOnUpdateError 默认false
Click to show internal directories.
Click to hide internal directories.