Update sets an item in the cache to its updated state.
(obj interface{})
| 131 | |
| 132 | // Update sets an item in the cache to its updated state. |
| 133 | func (c *cache) Update(obj interface{}) error { |
| 134 | key, err := c.keyFunc(obj) |
| 135 | if err != nil { |
| 136 | return KeyError{obj, err} |
| 137 | } |
| 138 | c.cacheStorage.Update(key, obj) |
| 139 | return nil |
| 140 | } |
| 141 | |
| 142 | // Delete removes an item from the cache. |
| 143 | func (c *cache) Delete(obj interface{}) error { |