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

Method GetIntWithExpiration

cache.go:319–323  ·  view source on GitHub ↗

GetIntWithExpiration returns the value and expiration or a not found error.

(key int64)

Source from the content-addressed store, hash-verified

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) {
320 var bKey [8]byte
321 binary.LittleEndian.PutUint64(bKey[:], uint64(key))
322 return cache.GetWithExpiration(bKey[:])
323}
324
325// DelInt deletes an item in the cache by int key and returns true or false if a delete occurred.
326func (cache *Cache) DelInt(key int64) (affected bool) {

Callers 1

TestInt64KeyFunction · 0.95

Calls 1

GetWithExpirationMethod · 0.95

Tested by 1

TestInt64KeyFunction · 0.76