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

Method Get

memcache/memcache.go:335–343  ·  view source on GitHub ↗

Get gets the item for the given key. ErrCacheMiss is returned for a memcache cache miss. The key must be at most 250 bytes in length.

(key string)

Source from the content-addressed store, hash-verified

333// Get gets the item for the given key. ErrCacheMiss is returned for a
334// memcache cache miss. The key must be at most 250 bytes in length.
335func (c *Client) Get(key string) (item *Item, err error) {
336 err = c.withKeyAddr(key, func(addr net.Addr) error {
337 return c.getFromAddr(addr, []string{key}, func(it *Item) { item = it })
338 })
339 if err == nil && item == nil {
340 err = ErrCacheMiss
341 }
342 return
343}
344
345// Touch updates the expiry for the given key. The seconds parameter is either
346// a Unix timestamp or, if seconds is less than 1 month, the number of seconds

Callers 3

PickServerMethod · 0.80
testWithClientFunction · 0.80
testTouchWithClientFunction · 0.80

Calls 2

withKeyAddrMethod · 0.95
getFromAddrMethod · 0.95

Tested by 2

testWithClientFunction · 0.64
testTouchWithClientFunction · 0.64