MCPcopy
hub / github.com/rclone/rclone / HasChunk

Method HasChunk

backend/cache/storage_memory.go:39–43  ·  view source on GitHub ↗

HasChunk confirms the existence of a single chunk of an object

(cachedObject *Object, offset int64)

Source from the content-addressed store, hash-verified

37
38// HasChunk confirms the existence of a single chunk of an object
39func (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
46func (m *Memory) GetChunk(cachedObject *Object, offset int64) ([]byte, error) {

Callers 2

runMethod · 0.45

Calls 2

GetMethod · 0.65
absMethod · 0.45

Tested by 1