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

Method run

cli/command_policy_show.go:31–51  ·  view source on GitHub ↗
(ctx context.Context, rep repo.Repository)

Source from the content-addressed store, hash-verified

29}
30
31func (c *commandPolicyShow) run(ctx context.Context, rep repo.Repository) error {
32 targets, err := c.policyTargets(ctx, rep)
33 if err != nil {
34 return err
35 }
36
37 for _, target := range targets {
38 effective, definition, _, err := policy.GetEffectivePolicy(ctx, rep, target)
39 if err != nil {
40 return errors.Wrapf(err, "can't get effective policy for %q", target)
41 }
42
43 if c.jo.jsonOutput {
44 c.out.printStdout("%s\n", c.jo.jsonBytes(effective))
45 } else {
46 printPolicy(&c.out, effective, definition)
47 }
48 }
49
50 return nil
51}
52
53type policyTableRow struct {
54 name string

Callers

nothing calls this directly

Calls 5

GetEffectivePolicyFunction · 0.92
printPolicyFunction · 0.85
policyTargetsMethod · 0.80
printStdoutMethod · 0.80
jsonBytesMethod · 0.80

Tested by

no test coverage detected