MCPcopy Index your code
hub / github.com/minio/mc / mainAdminUserRemove

Function mainAdminUserRemove

cmd/admin-user-remove.go:58–80  ·  view source on GitHub ↗

mainAdminUserRemove is the handle for "mc admin user remove" command.

(ctx *cli.Context)

Source from the content-addressed store, hash-verified

56
57// mainAdminUserRemove is the handle for "mc admin user remove" command.
58func mainAdminUserRemove(ctx *cli.Context) error {
59 checkAdminUserRemoveSyntax(ctx)
60
61 console.SetColor("UserMessage", color.New(color.FgGreen))
62
63 // Get the alias parameter from cli
64 args := ctx.Args()
65 aliasedURL := args.Get(0)
66
67 // Create a new MinIO Admin Client
68 client, err := newAdminClient(aliasedURL)
69 fatalIf(err, "Unable to initialize admin connection.")
70
71 e := client.RemoveUser(globalContext, args.Get(1))
72 fatalIf(probe.NewError(e).Trace(args...), "Unable to remove %s", args.Get(1))
73
74 printMsg(userMessage{
75 op: ctx.Command.Name,
76 AccessKey: args.Get(1),
77 })
78
79 return nil
80}

Callers

nothing calls this directly

Calls 7

NewErrorFunction · 0.92
newAdminClientFunction · 0.85
fatalIfFunction · 0.85
printMsgFunction · 0.85
TraceMethod · 0.80
GetMethod · 0.65

Tested by

no test coverage detected