(ctx context.Context, rep repo.DirectRepository, output chan indexBlobPlusContentInfo)
| 55 | } |
| 56 | |
| 57 | func (c *commandIndexInspect) runWithOutput(ctx context.Context, rep repo.DirectRepository, output chan indexBlobPlusContentInfo) error { |
| 58 | switch { |
| 59 | case c.all: |
| 60 | return c.inspectAllBlobs(ctx, rep, true, output) |
| 61 | case c.active: |
| 62 | return c.inspectAllBlobs(ctx, rep, false, output) |
| 63 | case len(c.blobIDs) > 0: |
| 64 | for _, indexBlobID := range c.blobIDs { |
| 65 | if err := c.inspectSingleIndexBlob(ctx, rep, blob.ID(indexBlobID), output); err != nil { |
| 66 | return err |
| 67 | } |
| 68 | } |
| 69 | default: |
| 70 | return errors.New("must pass either --all, --active or provide a list of blob IDs to inspect") |
| 71 | } |
| 72 | |
| 73 | return nil |
| 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) |
no test coverage detected