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

Method run

cli/command_notification_profile_show.go:33–58  ·  view source on GitHub ↗
(ctx context.Context, rep repo.Repository)

Source from the content-addressed store, hash-verified

31}
32
33func (c *commandNotificationProfileShow) run(ctx context.Context, rep repo.Repository) error {
34 pc, err := notifyprofile.GetProfile(ctx, rep, c.profileName)
35 if err != nil {
36 return errors.Wrap(err, "unable to list notification profiles")
37 }
38
39 summ := getProfileSummary(ctx, pc)
40
41 if !c.jo.jsonOutput {
42 c.out.printStdout("Profile %q Type %q Minimum Severity: %v\n%v\n",
43 summ.ProfileName,
44 pc.MethodConfig.Type,
45 notification.SeverityToString[pc.MinSeverity],
46 summ.Summary)
47
48 return nil
49 }
50
51 if c.raw {
52 c.out.printStdout("%s\n", c.jo.jsonBytes(pc))
53 } else {
54 c.out.printStdout("%s\n", c.jo.jsonBytes(summ))
55 }
56
57 return nil
58}

Callers

nothing calls this directly

Calls 4

GetProfileFunction · 0.92
getProfileSummaryFunction · 0.85
printStdoutMethod · 0.80
jsonBytesMethod · 0.80

Tested by

no test coverage detected