Peek returns the value or not found error, without updating access time or counters. Warning: No expiry check is performed so if an expired value is found, it will be returned without error
(key []byte)
| 209 | // Warning: No expiry check is performed so if an expired value is found, it will be |
| 210 | // returned without error |
| 211 | func (cache *Cache) Peek(key []byte) (value []byte, err error) { |
| 212 | hashVal := hashFunc(key) |
| 213 | segID := hashVal & segmentAndOpVal |
| 214 | cache.locks[segID].Lock() |
| 215 | value, _, err = cache.segments[segID].get(key, nil, hashVal, true) |
| 216 | cache.locks[segID].Unlock() |
| 217 | return |
| 218 | } |
| 219 | |
| 220 | // PeekWithExpiration returns the value and expiration time, without updating access time or counters. |
| 221 | // Warning: No expiry check is performed so if an expired value is found, it will be |