Documentation ¶
Overview ¶
Package lcache represents simple, non-thread safe LRU cache implementation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache interface { // Set sets a cache element value, // if it's not presented - inserts new element. Set(key, value interface{}) // Get returns a key's value from the cache. Get(key interface{}) (interface{}, bool) // Remove removes element from the cache. Remove(key interface{}) bool // Clears all cache elements. Clear() // Size returns number of the cache elements. Size() int }
Cache represents basic cache interface.
type LRUCache ¶
type LRUCache struct {
// contains filtered or unexported fields
}
LRUCache implements a fixed size LRU cache.
func (*LRUCache) Remove ¶
Remove removes element from the cache by key. Returns true if the element was removed, false otherwise.
Click to show internal directories.
Click to hide internal directories.