(ctx context.Context, rep repo.DirectRepository)
| 35 | } |
| 36 | |
| 37 | func (c *commandBlobList) run(ctx context.Context, rep repo.DirectRepository) error { |
| 38 | var jl jsonList |
| 39 | |
| 40 | jl.begin(&c.jo) |
| 41 | defer jl.end() |
| 42 | |
| 43 | //nolint:wrapcheck |
| 44 | return rep.BlobReader().ListBlobs(ctx, blob.ID(c.blobListPrefix), func(b blob.Metadata) error { |
| 45 | if !c.shouldInclude(b) { |
| 46 | return nil |
| 47 | } |
| 48 | |
| 49 | if c.jo.jsonOutput { |
| 50 | jl.emit(b) |
| 51 | } else { |
| 52 | c.out.printStdout("%-70v %10v %v\n", b.BlobID, b.Length, formatTimestamp(b.Timestamp)) |
| 53 | } |
| 54 | |
| 55 | return nil |
| 56 | }) |
| 57 | } |
| 58 | |
| 59 | func (c *commandBlobList) shouldInclude(b blob.Metadata) bool { |
| 60 | if c.dataOnly { |
nothing calls this directly
no test coverage detected