MCPcopy
hub / github.com/kopia/kopia / run

Method run

cli/command_show.go:27–41  ·  view source on GitHub ↗
(ctx context.Context, rep repo.Repository)

Source from the content-addressed store, hash-verified

25}
26
27func (c *commandShow) run(ctx context.Context, rep repo.Repository) error {
28 oid, err := snapshotfs.ParseObjectIDWithPath(ctx, rep, c.path)
29 if err != nil {
30 return errors.Wrapf(err, "unable to parse ID: %v", c.path)
31 }
32
33 r, err := rep.OpenObject(ctx, oid)
34 if err != nil {
35 return errors.Wrapf(err, "error opening object %v", oid)
36 }
37
38 defer r.Close() //nolint:errcheck
39
40 return errors.Wrap(iocopy.JustCopy(c.out.stdout(), r), "unable to copy data")
41}

Callers

nothing calls this directly

Calls 5

ParseObjectIDWithPathFunction · 0.92
JustCopyFunction · 0.92
OpenObjectMethod · 0.65
CloseMethod · 0.65
stdoutMethod · 0.65

Tested by

no test coverage detected