Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface { Get(string, UpdateFunc) (interface{}, error) GetStats() (inserts, hits, misses uint64) Evict(string) Clear() }
func NewLRUMemCache ¶
func NewLRUTimeoutMemCache ¶
type LRUMemCache ¶
type LRUMemCache struct {
// contains filtered or unexported fields
}
func (*LRUMemCache) Clear ¶
func (c *LRUMemCache) Clear()
func (*LRUMemCache) Evict ¶
func (c *LRUMemCache) Evict(key string)
func (*LRUMemCache) Get ¶
func (c *LRUMemCache) Get(key string, update UpdateFunc) (interface{}, error)
type LRUTimeoutMemCache ¶
type LRUTimeoutMemCache struct {
// contains filtered or unexported fields
}
func (*LRUTimeoutMemCache) Clear ¶
func (c *LRUTimeoutMemCache) Clear()
func (*LRUTimeoutMemCache) Evict ¶
func (c *LRUTimeoutMemCache) Evict(key string)
func (*LRUTimeoutMemCache) Get ¶
func (c *LRUTimeoutMemCache) Get( key string, update UpdateFunc, ) (interface{}, error)
type UpdateFunc ¶
UpdateFunc is called if a cache item doesn't exists. It should return the new value, the size of the value (not including key), and an error.
Click to show internal directories.
Click to hide internal directories.