MCPcopy
hub / github.com/perkeep/perkeep / StatBlobs

Method StatBlobs

pkg/blobserver/diskpacked/diskpacked.go:446–457  ·  view source on GitHub ↗

arbitrary

(ctx context.Context, blobs []blob.Ref, fn func(blob.SizedRef) error)

Source from the content-addressed store, hash-verified

444var statGate = syncutil.NewGate(20) // arbitrary
445
446func (s *storage) StatBlobs(ctx context.Context, blobs []blob.Ref, fn func(blob.SizedRef) error) error {
447 return blobserver.StatBlobsParallelHelper(ctx, blobs, fn, statGate, func(br blob.Ref) (sb blob.SizedRef, err error) {
448 m, err := s.meta(br)
449 if err == nil {
450 return m.SizedRef(br), nil
451 }
452 if errors.Is(err, os.ErrNotExist) {
453 return sb, nil
454 }
455 return sb, err
456 })
457}
458
459func (s *storage) EnumerateBlobs(ctx context.Context, dest chan<- blob.SizedRef, after string, limit int) (err error) {
460 defer close(dest)

Callers

nothing calls this directly

Calls 3

metaMethod · 0.95
StatBlobsParallelHelperFunction · 0.92
SizedRefMethod · 0.45

Tested by

no test coverage detected