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

Method runUserList

cli/command_user_list.go:24–44  ·  view source on GitHub ↗
(ctx context.Context, rep repo.Repository)

Source from the content-addressed store, hash-verified

22}
23
24func (c *commandServerUserList) runUserList(ctx context.Context, rep repo.Repository) error {
25 var jl jsonList
26
27 jl.begin(&c.jo)
28 defer jl.end()
29
30 profiles, err := user.ListUserProfiles(ctx, rep)
31 if err != nil {
32 return errors.Wrap(err, "error listing user profiles")
33 }
34
35 for _, p := range profiles {
36 if c.jo.jsonOutput {
37 jl.emit(p)
38 } else {
39 c.out.printStdout("%v\n", p.Username)
40 }
41 }
42
43 return nil
44}

Callers

nothing calls this directly

Calls 5

beginMethod · 0.95
endMethod · 0.95
emitMethod · 0.95
ListUserProfilesFunction · 0.92
printStdoutMethod · 0.80

Tested by

no test coverage detected