Delete removes an item from the cache.
(obj interface{})
| 141 | |
| 142 | // Delete removes an item from the cache. |
| 143 | func (c *cache) Delete(obj interface{}) error { |
| 144 | key, err := c.keyFunc(obj) |
| 145 | if err != nil { |
| 146 | return KeyError{obj, err} |
| 147 | } |
| 148 | c.cacheStorage.Delete(key) |
| 149 | return nil |
| 150 | } |
| 151 | |
| 152 | // List returns a list of all the items. |
| 153 | // List is completely threadsafe as long as you treat all items as immutable. |