MCPcopy Index your code
hub / github.com/kopia/kopia / run

Method run

cli/command_blob_list.go:37–57  ·  view source on GitHub ↗
(ctx context.Context, rep repo.DirectRepository)

Source from the content-addressed store, hash-verified

35}
36
37func (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
59func (c *commandBlobList) shouldInclude(b blob.Metadata) bool {
60 if c.dataOnly {

Callers

nothing calls this directly

Calls 9

beginMethod · 0.95
endMethod · 0.95
shouldIncludeMethod · 0.95
emitMethod · 0.95
IDTypeAlias · 0.92
formatTimestampFunction · 0.85
printStdoutMethod · 0.80
ListBlobsMethod · 0.65
BlobReaderMethod · 0.65

Tested by

no test coverage detected