Documentation
¶
Overview ¶
Package ctl is the admin verb set shared by mashctl and the deprecated `mash admin`.
Index ¶
- Variables
- func AliasedRefusal(err error, name string) (msg string, ok bool)
- func NewFormRequested(args []string) bool
- func NoRevokeWarning(name, user string) string
- func OpenAdmin(prog string, cfg config.Config) (*madmin.Admin, context.Context, func(), error)
- func Run(prog string, cfg config.Config, args []string, stdout, stderr io.Writer) int
- func ShortKey(k string) string
- func Usage(prog string) string
Constants ¶
This section is empty.
Variables ¶
var RevokeUsers func(ctx context.Context, cfg config.Config, users []string, stdout io.Writer) error
RevokeUsers revokes NATS user keys in the account JWT; mashctl sets it, which has the key store. The system account credentials come from MASH_SYS_CREDS or the init server's sys.creds, the server count from MASH_SERVERS. It stays nil in `mash admin`, which has neither: deprovision then only advises.
Functions ¶
func AliasedRefusal ¶ added in v0.4.0
AliasedRefusal words admin.ErrAliased, the refusal to remove a legacy endpoint that a new-form endpoint names as its alias (ADR 0076, ADR 0088), as one line that names both endpoints, says nothing was changed and says what to do. ok is false for any other error.
func NewFormRequested ¶ added in v0.4.0
NewFormRequested reports whether args (a verb and its arguments) ask provision or deprovision for the three-token form: a --agent, --owner or --alias flag, or a canonical or flat positional. Flags are read in pairs, like the verbs' own parsers, so a value that looks like a flag is a value.
func NoRevokeWarning ¶ added in v0.3.3
NoRevokeWarning is the stderr block for a removal with --no-revoke: the user key keeps working.
func OpenAdmin ¶ added in v0.3.3
OpenAdmin connects to the server with the admin credentials and returns the admin handle, a context carrying the command's deadline (admin_timeout, else 30 seconds) and a func that releases both. prog is the command prefix of error text. The caller must call the func when done.
func Run ¶
Run executes one admin verb. prog is the command prefix used in usage and error text: "mashctl" or "mash admin".
Types ¶
This section is empty.