MCPcopy
hub / github.com/kopia/kopia / iterateBackingContents

Function iterateBackingContents

repo/object/object_reader.go:244–260  ·  view source on GitHub ↗
(ctx context.Context, r contentReader, oid ID, tracker *contentIDTracker, callbackFunc func(contentID content.ID) error)

Source from the content-addressed store, hash-verified

242}
243
244func iterateBackingContents(ctx context.Context, r contentReader, oid ID, tracker *contentIDTracker, callbackFunc func(contentID content.ID) error) error {
245 if indexObjectID, ok := oid.IndexObjectID(); ok {
246 return iterateIndirectObjectContents(ctx, r, indexObjectID, tracker, callbackFunc)
247 }
248
249 if contentID, _, ok := oid.ContentID(); ok {
250 if err := callbackFunc(contentID); err != nil {
251 return err
252 }
253
254 tracker.addContentID(contentID)
255
256 return nil
257 }
258
259 return errors.Errorf("unrecognized object type: %v", oid)
260}
261
262type indirectObject struct {
263 StreamID string `json:"stream"`

Callers 3

PrefetchBackingContentsFunction · 0.85
VerifyObjectFunction · 0.85

Calls 5

IndexObjectIDMethod · 0.80
ContentIDMethod · 0.80
addContentIDMethod · 0.80
ErrorfMethod · 0.80

Tested by

no test coverage detected