Delete deletes the item from the cache if it exists.
(key interface{})
| 212 | |
| 213 | // Delete deletes the item from the cache if it exists. |
| 214 | func (w *InMemoryAutoRefresh) Delete(key interface{}) { |
| 215 | w.lock.Lock() |
| 216 | defer w.lock.Unlock() |
| 217 | w.toDelete.Remove(key) |
| 218 | w.lruMap.Remove(key) |
| 219 | } |
| 220 | |
| 221 | func (w *InMemoryAutoRefresh) Get(id ItemID) (Item, error) { |
| 222 | if val, ok := w.lruMap.Get(id); ok { |
no test coverage detected