Add an item to the cache, replacing any existing item, using the default expiration.
(k string, x interface{})
| 84 | // Add an item to the cache, replacing any existing item, using the default |
| 85 | // expiration. |
| 86 | func (c *cache) SetDefault(k string, x interface{}) { |
| 87 | c.Set(k, x, DefaultExpiration) |
| 88 | } |
| 89 | |
| 90 | // Add an item to the cache only if an item doesn't already exist for the given |
| 91 | // key, or if the existing item has expired. Returns an error otherwise. |