MCPcopy
hub / github.com/bradfitz/gomemcache / Touch

Method Touch

memcache/memcache.go:350–354  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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.
350func (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
356func (c *Client) withKeyAddr(key string, fn func(net.Addr) error) (err error) {
357 if !legalKey(key) {

Callers 1

testTouchWithClientFunction · 0.80

Calls 2

withKeyAddrMethod · 0.95
touchFromAddrMethod · 0.95

Tested by 1

testTouchWithClientFunction · 0.64