Documentation ¶
Index ¶
- type Cache
- type CacheGroup
- type CachedItem
- type GetUpdateFunc
- type GroupManager
- type Item
- func (h *Item) GetUpdate(d []interface{}) ([]string, error)
- func (h *Item) Key(obj interface{}) (string, error)
- func (h *Item) Load() ([]interface{}, error)
- func (h *Item) Name() string
- func (h *Item) Period() time.Duration
- func (h *Item) TTL() time.Duration
- func (h *Item) Update(ids []string) ([]interface{}, error)
- type LoadFunc
- type UpdateFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface { Add(obj interface{}) error Update(obj interface{}) error Delete(obj interface{}) error List() []interface{} Get(string) (item interface{}, err error) Start(<-chan struct{}) Reload(keys []string) (items []interface{}, err error) ReloadAll() (items []interface{}, err error) WaitForReady() }
func NewCache ¶
func NewCache(kind string, item CachedItem) Cache
type CacheGroup ¶
type CachedItem ¶
type CachedItem interface { TTL() time.Duration Name() string Period() time.Duration Update(keys []string) ([]interface{}, error) Load() ([]interface{}, error) Key(obj interface{}) (string, error) GetUpdate(d []interface{}) ([]string, error) }
func NewCacheItem ¶
func NewCacheItem(name string, ttl, period time.Duration, keyf expirationcache.KeyFunc, update UpdateFunc, load LoadFunc, getUpdate GetUpdateFunc, ) CachedItem
NewCacheItem new a Item implement CachedItem interface
type GetUpdateFunc ¶
type GroupManager ¶
func NewGroupManager ¶
func NewGroupManager(kind string, items []CachedItem, ch <-chan struct{}) *GroupManager
func (*GroupManager) Run ¶
func (m *GroupManager) Run()
type Item ¶
type Item struct {
// contains filtered or unexported fields
}
Item implement CachedItem interface
type UpdateFunc ¶
Click to show internal directories.
Click to hide internal directories.