(ctx context.Context, rep repo.DirectRepository, blobID blob.ID, output chan indexBlobPlusContentInfo)
| 140 | } |
| 141 | |
| 142 | func (c *commandIndexInspect) inspectSingleIndexBlob(ctx context.Context, rep repo.DirectRepository, blobID blob.ID, output chan indexBlobPlusContentInfo) error { |
| 143 | log(ctx).Debugf("Inspecting blob %v...", blobID) |
| 144 | |
| 145 | bm, err := rep.BlobReader().GetMetadata(ctx, blobID) |
| 146 | if err != nil { |
| 147 | return errors.Wrapf(err, "unable to get metadata for %v", blobID) |
| 148 | } |
| 149 | |
| 150 | var data gather.WriteBuffer |
| 151 | defer data.Close() |
| 152 | |
| 153 | if err = rep.BlobReader().GetBlob(ctx, blobID, 0, -1, &data); err != nil { |
| 154 | return errors.Wrapf(err, "unable to get data for %v", blobID) |
| 155 | } |
| 156 | |
| 157 | entries, err := content.ParseIndexBlob(blobID, data.Bytes(), rep.ContentReader().ContentFormat()) |
| 158 | if err != nil { |
| 159 | return errors.Wrapf(err, "unable to recover index from %v", blobID) |
| 160 | } |
| 161 | |
| 162 | for _, ent := range entries { |
| 163 | output <- indexBlobPlusContentInfo{bm, ent} |
| 164 | } |
| 165 | |
| 166 | return nil |
| 167 | } |
no test coverage detected