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 {
// 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 (CacheMemory) DeleteExpired ¶
func (c CacheMemory) DeleteExpired()
Delete all expired items from the cache.
func (CacheMemory) SetWithExpiration ¶
Click to show internal directories.
Click to hide internal directories.