Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ExpireCallback ¶
type ExpireCallback func(key interface{})
type SizeCache ¶
type SizeCache struct {
// contains filtered or unexported fields
}
func NewWithExpireCallback ¶
func NewWithExpireCallback(maxSize uint64, cb ExpireCallback) *SizeCache
NewWithExpireCallback creates a SizeCache that will hold up to |maxSize| item data, and will call cb(key) when the item corresponding with that key expires.
func (*SizeCache) Add ¶
Add will add this element to the cache at the back of the queue as long it's size does not exceed maxSize. If the addition of this entry causes the size of the cache to exceed maxSize, the necessary entries at the front of the queue will be deleted in order to keep the total cache size below maxSize.
func (*SizeCache) Drop ¶
func (c *SizeCache) Drop(key interface{})
Drop will remove the element associated with the given key from the cache.
Click to show internal directories.
Click to hide internal directories.