Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface {
Set(key string, value interface{})
Get(key string) (interface{}, bool)
Delete(key string)
Status() *CacheStatus
}
this is a interface which defines some common functions
type CacheStatus ¶
return status of chache
type MemCache ¶
type MemCache struct {
// contains filtered or unexported fields
}
MemCache is an LRU cache. It is safe for concurrent access.
func NewMemCache ¶
NewMemCache If maxItemSize is zero, the cache has no limit. if maxItemSize is not zero, when cache's size beyond maxItemSize,start to swap
func (*MemCache) RemoveOldest ¶
func (c *MemCache) RemoveOldest()
RemoveOldest remove the oldest key
func (*MemCache) Status ¶
func (c *MemCache) Status() *CacheStatus
Status return the status of cache
Click to show internal directories.
Click to hide internal directories.