MCPcopy Index your code
hub / github.com/perkeep/perkeep / populateMutationMapForSchema

Method populateMutationMapForSchema

pkg/index/receive.go:333–351  ·  view source on GitHub ↗
(ctx context.Context, fetcher *missTrackFetcher, schemaBlob *schema.Blob, mm *mutationMap)

Source from the content-addressed store, hash-verified

331}
332
333func (ix *Index) populateMutationMapForSchema(ctx context.Context, fetcher *missTrackFetcher, schemaBlob *schema.Blob, mm *mutationMap) error {
334 switch schemaBlob.Type() {
335 case schema.TypePermanode:
336 _, err := ix.verifySignature(ctx, fetcher, schemaBlob)
337 return err
338 case schema.TypeClaim:
339 vr, err := ix.verifySignature(ctx, fetcher, schemaBlob)
340 if err != nil {
341 return err
342 }
343 return ix.populateClaim(ctx, fetcher, schemaBlob, vr, mm)
344 case schema.TypeFile:
345 return ix.populateFile(ctx, fetcher, schemaBlob, mm)
346 case schema.TypeDirectory:
347 return ix.populateDir(ctx, fetcher, schemaBlob, mm)
348 default:
349 return nil
350 }
351}
352
353// populateMutationMap populates keys & values that will be committed
354// into the returned map.

Callers 1

populateMutationMapMethod · 0.95

Calls 5

verifySignatureMethod · 0.95
populateClaimMethod · 0.95
populateFileMethod · 0.95
populateDirMethod · 0.95
TypeMethod · 0.45

Tested by

no test coverage detected