Touch updates the expiry for the given key. The seconds parameter is either a Unix timestamp or, if seconds is less than 1 month, the number of seconds into the future at which time the item will expire. Zero means the item has no expiration time. ErrCacheMiss is returned if the key is not in the ca
(key string, seconds int32)
| 348 | // no expiration time. ErrCacheMiss is returned if the key is not in the cache. |
| 349 | // The key must be at most 250 bytes in length. |
| 350 | func (c *Client) Touch(key string, seconds int32) (err error) { |
| 351 | return c.withKeyAddr(key, func(addr net.Addr) error { |
| 352 | return c.touchFromAddr(addr, []string{key}, seconds) |
| 353 | }) |
| 354 | } |
| 355 | |
| 356 | func (c *Client) withKeyAddr(key string, fn func(net.Addr) error) (err error) { |
| 357 | if !legalKey(key) { |