Clear removes everything from the cache
()
| 238 | |
| 239 | // Clear removes everything from the cache |
| 240 | func (c *Cache) Clear() { |
| 241 | c.mu.Lock() |
| 242 | for key, entry := range c.cache { |
| 243 | c.finalize(entry.value) |
| 244 | delete(c.cache, key) |
| 245 | } |
| 246 | c.mu.Unlock() |
| 247 | } |
| 248 | |
| 249 | // Entries returns the number of entries in the cache |
| 250 | func (c *Cache) Entries() int { |