ctl

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2026 License: Apache-2.0 Imports: 23 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package ctl is the admin verb set shared by mashctl and the deprecated `mash admin`.

Index

Constants

This section is empty.

Variables

View Source
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

func AliasedRefusal(err error, name string) (msg string, ok bool)

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

func NewFormRequested(args []string) bool

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

func NoRevokeWarning(name, user string) string

NoRevokeWarning is the stderr block for a removal with --no-revoke: the user key keeps working.

func OpenAdmin added in v0.3.3

func OpenAdmin(prog string, cfg config.Config) (*madmin.Admin, context.Context, func(), error)

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

func Run(prog string, cfg config.Config, args []string, stdout, stderr io.Writer) int

Run executes one admin verb. prog is the command prefix used in usage and error text: "mashctl" or "mash admin".

func ShortKey added in v0.3.3

func ShortKey(k string) string

ShortKey is the first 8 characters of a key for messages, or all of it when it is shorter: a user key read from a directory record may be short or malformed, and slicing it must never panic.

func Usage

func Usage(prog string) string

Usage is the full verb listing for prog ("mashctl" or "mash admin").

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL