Get returns the value or not found error.
(key []byte)
| 78 | |
| 79 | // Get returns the value or not found error. |
| 80 | func (cache *Cache) Get(key []byte) (value []byte, err error) { |
| 81 | hashVal := hashFunc(key) |
| 82 | segID := hashVal & segmentAndOpVal |
| 83 | cache.locks[segID].Lock() |
| 84 | value, _, err = cache.segments[segID].get(key, nil, hashVal, false) |
| 85 | cache.locks[segID].Unlock() |
| 86 | return |
| 87 | } |
| 88 | |
| 89 | // MultiGet returns values and errors for the given keys. The returned slices |
| 90 | // have the same length as keys; values[i] and errs[i] correspond to keys[i]. |