(ctx context.Context, rep repo.DirectRepository, includeInactive bool, output chan indexBlobPlusContentInfo)
| 74 | } |
| 75 | |
| 76 | func (c *commandIndexInspect) inspectAllBlobs(ctx context.Context, rep repo.DirectRepository, includeInactive bool, output chan indexBlobPlusContentInfo) error { |
| 77 | indexes, err := rep.IndexBlobs(ctx, includeInactive) |
| 78 | if err != nil { |
| 79 | return errors.Wrap(err, "error listing index blobs") |
| 80 | } |
| 81 | |
| 82 | indexesCh := make(chan indexblob.Metadata, len(indexes)) |
| 83 | for _, bm := range indexes { |
| 84 | indexesCh <- bm |
| 85 | } |
| 86 | |
| 87 | close(indexesCh) |
| 88 | |
| 89 | var eg errgroup.Group |
| 90 | |
| 91 | for range c.parallel { |
| 92 | eg.Go(func() error { |
| 93 | for bm := range indexesCh { |
| 94 | if err := c.inspectSingleIndexBlob(ctx, rep, bm.BlobID, output); err != nil { |
| 95 | return err |
| 96 | } |
| 97 | } |
| 98 | |
| 99 | return nil |
| 100 | }) |
| 101 | } |
| 102 | |
| 103 | //nolint:wrapcheck |
| 104 | return eg.Wait() |
| 105 | } |
| 106 | |
| 107 | func (c *commandIndexInspect) dumpIndexBlobEntries(entries chan indexBlobPlusContentInfo) { |
| 108 | for ent := range entries { |
no test coverage detected