Documentation ¶
Index ¶
- type LRU
- type LRUCache
- func (l *LRUCache) Add(k, v interface{})
- func (l *LRUCache) Clear()
- func (l *LRUCache) Contains(key interface{}) bool
- func (l *LRUCache) ContainsOrAdd(key, value interface{}) bool
- func (l *LRUCache) Get(key interface{}) (value interface{})
- func (l *LRUCache) Len() uint64
- func (l *LRUCache) Remove(key interface{}) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LRU ¶
type LRU struct { Cap uint64 // contains filtered or unexported fields }
LRU non-thread safe fixed size LRU cache
func NewLRUCache ¶
NewLRUCache returns a new non-concurrent-safe LRU cache with input capacity
type LRUCache ¶
type LRUCache struct {
// contains filtered or unexported fields
}
LRUCache thread safe fixed size LRU cache
func (*LRUCache) Add ¶
func (l *LRUCache) Add(k, v interface{})
Add new entry to Cache return true if entry removed
func (*LRUCache) ContainsOrAdd ¶
ContainsOrAdd checks if cache contains key if not adds to cache
func (*LRUCache) Get ¶
func (l *LRUCache) Get(key interface{}) (value interface{})
Get looks up a key's value from the cache.
Click to show internal directories.
Click to hide internal directories.