MCPcopy
hub / github.com/coocood/freecache / GetInt

Method GetInt

cache.go:312–316  ·  view source on GitHub ↗

GetInt returns the value for an integer within the cache or a not found error.

(key int64)

Source from the content-addressed store, hash-verified

310
311// GetInt returns the value for an integer within the cache or a not found error.
312func (cache *Cache) GetInt(key int64) (value []byte, err error) {
313 var bKey [8]byte
314 binary.LittleEndian.PutUint64(bKey[:], uint64(key))
315 return cache.Get(bKey[:])
316}
317
318// GetIntWithExpiration returns the value and expiration or a not found error.
319func (cache *Cache) GetIntWithExpiration(key int64) (value []byte, expireAt uint32, err error) {

Callers 2

TestInt64KeyFunction · 0.95
TestRaceFunction · 0.95

Calls 1

GetMethod · 0.95

Tested by 2

TestInt64KeyFunction · 0.76
TestRaceFunction · 0.76