MCPcopy
hub / github.com/kopia/kopia / runWithOutput

Method runWithOutput

cli/command_index_inspect.go:57–74  ·  view source on GitHub ↗
(ctx context.Context, rep repo.DirectRepository, output chan indexBlobPlusContentInfo)

Source from the content-addressed store, hash-verified

55}
56
57func (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
76func (c *commandIndexInspect) inspectAllBlobs(ctx context.Context, rep repo.DirectRepository, includeInactive bool, output chan indexBlobPlusContentInfo) error {
77 indexes, err := rep.IndexBlobs(ctx, includeInactive)

Callers 1

runMethod · 0.95

Calls 3

inspectAllBlobsMethod · 0.95
IDTypeAlias · 0.92

Tested by

no test coverage detected