Documentation ¶
Index ¶
- Constants
- type Cache
- type CacheMemory
- func (c *CacheMemory) CloneItems() map[string]Item
- func (c *CacheMemory) Delete(k string)
- func (c *CacheMemory) DeleteExpired()
- func (c *CacheMemory) Empty()
- func (c *CacheMemory) Get(k string) (interface{}, bool)
- func (c *CacheMemory) ItemCount() int
- func (c *CacheMemory) OnEvicted(f func(string, interface{}))
- func (c *CacheMemory) Scan(f func([]byte, []byte) error)
- func (c *CacheMemory) Set(k string, x interface{})
- func (c *CacheMemory) SetWithExpiration(k string, x interface{}, d time.Duration)
- type Item
Constants ¶
View Source
const ( NoExpiration time.Duration = -1 DefaultExpiration time.Duration = 0 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheMemory ¶
type CacheMemory struct { DefaultExpiration time.Duration Items map[string]Item // contains filtered or unexported fields }
func New ¶
func New(defaultExpiration, cleanupInterval time.Duration) *CacheMemory
func NewFrom ¶
func NewFrom(defaultExpiration, cleanupInterval time.Duration, items map[string]Item) *CacheMemory
func (*CacheMemory) CloneItems ¶
func (c *CacheMemory) CloneItems() map[string]Item
func (*CacheMemory) Delete ¶
func (c *CacheMemory) Delete(k string)
func (*CacheMemory) DeleteExpired ¶
func (c *CacheMemory) DeleteExpired()
Delete all expired items from the cache.
func (*CacheMemory) Empty ¶
func (c *CacheMemory) Empty()
func (*CacheMemory) Get ¶
func (c *CacheMemory) Get(k string) (interface{}, bool)
func (*CacheMemory) ItemCount ¶
func (c *CacheMemory) ItemCount() int
func (*CacheMemory) OnEvicted ¶
func (c *CacheMemory) OnEvicted(f func(string, interface{}))
func (*CacheMemory) Set ¶
func (c *CacheMemory) Set(k string, x interface{})
func (*CacheMemory) SetWithExpiration ¶
func (c *CacheMemory) SetWithExpiration(k string, x interface{}, d time.Duration)
Click to show internal directories.
Click to hide internal directories.