type Cache … type Key … type entry … // New creates a new Cache. // If maxEntries is zero, the cache has no limit and it's assumed // that eviction is done by the caller. func New(maxEntries int) *Cache { … } // Add adds a value to the cache. func (c *Cache) Add(key Key, value interface{ … } // Get looks up a key's value from the cache. func (c *Cache) Get(key Key) (value interface{ … } // Remove removes the provided key from the cache. func (c *Cache) Remove(key Key) { … } // RemoveOldest removes the oldest item from the cache. func (c *Cache) RemoveOldest() { … } func (c *Cache) removeElement(e *list.Element) { … } // Len returns the number of items in the cache. func (c *Cache) Len() int { … } // Clear purges all stored items from the cache. func (c *Cache) Clear() { … }