Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct {
// contains filtered or unexported fields
}
Cache is a LRU replacement cache
func (*Cache) Delete ¶
Delete removes the key-value from the cache. It is a noop if no match is found.
func (*Cache) Get ¶
Get returns the value for the given key. It returns the value and true if found but false if otherwise
type InMemoryStore ¶
InMemoryStore is an in-memory implementation of Store. Which is safe for concurrent use.
func (*InMemoryStore) Delete ¶
func (i *InMemoryStore) Delete(key string)
Delete removes the given value for the key from the store.
type Store ¶
type Store interface { Get(k string) (*list.Element, bool) Set(k string, e *list.Element) Delete(k string) }
Store is the underlying hash map used for fast access and deletion for the LRU Cache
func NewInMemoryStore ¶
func NewInMemoryStore() Store
NewInMemoryStore creates a new in-memory store.
Click to show internal directories.
Click to hide internal directories.