HasChunk confirms the existence of a single chunk of an object
(cachedObject *Object, offset int64)
| 37 | |
| 38 | // HasChunk confirms the existence of a single chunk of an object |
| 39 | func (m *Memory) HasChunk(cachedObject *Object, offset int64) bool { |
| 40 | key := cachedObject.abs() + "-" + strconv.FormatInt(offset, 10) |
| 41 | _, found := m.db.Get(key) |
| 42 | return found |
| 43 | } |
| 44 | |
| 45 | // GetChunk will retrieve a single chunk which belongs to a cached object or an error if it doesn't find it |
| 46 | func (m *Memory) GetChunk(cachedObject *Object, offset int64) ([]byte, error) { |