Documentation
¶
Overview ¶
Package cli holds what the commands of the CLI share: the printer, the theme, the tables and the help.
Index ¶
- Constants
- Variables
- func APIReason(status int) string
- func ApplyTheme(root *cobra.Command, version string)
- func Banner(w io.Writer) string
- func Capture(fn func()) string
- func DocsPaletteCSS() string
- func DocsPaletteTS() string
- func Err(w io.Writer, s string) string
- func ExitCode(err error) int
- func Failure(w io.Writer, msg string) string
- func Flags(w io.Writer, usages string) string
- func FlushKV()
- func FlushTraceID()
- func FormatAge(d time.Duration) string
- func FormatBytes(b int) string
- func FormatDuration(s string) string
- func GuardGroups(root *cobra.Command)
- func HandleError(err error, _ *slog.Logger)
- func Heading(w io.Writer, s string) string
- func HelpJSON(c *cobra.Command, version string) ([]byte, error)
- func IsOSFamilySupported(distro string, version string) (string, bool)
- func IsUsageError(err error) bool
- func LocalTime(t time.Time) string
- func LogFatal(_ *slog.Logger, message string, err error, kvPairs ...any)
- func LogHandler(w io.Writer, level slog.Leveler, asJSON bool, color bool) slog.Handler
- func Mute(w io.Writer, s string) string
- func OK(w io.Writer, s string) string
- func Plain(s string) string
- func PrintBlock(title string, pairs ...string)
- func PrintCompactTable(sections []Section)
- func PrintError(w io.Writer, cmd *cobra.Command, err error, jsonOutput bool)
- func PrintErrors(errors []ErrorEntry)
- func PrintHeading(title string)
- func PrintJSON(body []byte)
- func PrintJobID(id string)
- func PrintKV(pairs ...string)
- func PrintTraceID(id string)
- func RenderStatus(status string) string
- func SetHeadingOrder(colors []lipgloss.Color)
- func SetJSONOutput(enabled bool)
- func Sub(w io.Writer, s string) string
- func Success(w io.Writer, msg string) string
- func TLSTransport(c config.ClientTLS) (http.RoundTripper, error)
- func Usages(fs *pflag.FlagSet) string
- func ValidateDistribution(logger *slog.Logger) error
- func WriteErrorJSON(w io.Writer, doc ErrorDocument)
- type ErrorDocument
- type ErrorEntry
- type HelpCommand
- type HelpDocument
- type HelpFlag
- type HelpSubcommand
- type Markdown
- func (m *Markdown) Age(d time.Duration) string
- func (m *Markdown) Block(title string, pairs ...string)
- func (m *Markdown) Bytes(n int64) string
- func (m *Markdown) Duration(d time.Duration) string
- func (m *Markdown) Heading(title string)
- func (m *Markdown) KV(pairs ...string)
- func (m *Markdown) Status(word string) string
- func (m *Markdown) String() string
- func (m *Markdown) Table(t command.Table)
- func (m *Markdown) Text(text string)
- func (m *Markdown) Time(t time.Time) string
- func (m *Markdown) Verdict(text string)
- type OSFamily
- type Printer
- func (Printer) Age(d time.Duration) string
- func (Printer) Block(title string, pairs ...string)
- func (Printer) Bytes(n int64) string
- func (Printer) Duration(d time.Duration) string
- func (Printer) Heading(title string)
- func (Printer) KV(pairs ...string)
- func (Printer) Status(word string) string
- func (Printer) Table(t command.Table)
- func (Printer) Text(text string)
- func (Printer) Time(t time.Time) string
- func (Printer) Verdict(text string)
- type ResultRow
- type Section
- type TableResult
- type TraceTransport
Constants ¶
const ( DocsPaletteCSSFile = "docs/src/css/palette.gen.css" DocsPaletteTSFile = "docs/src/palette.gen.ts" )
DocsPaletteCSSFile and DocsPaletteTSFile are where the docs site keeps the palette that DocsPaletteCSS and DocsPaletteTS write, from the repository's root.
const ( // ReasonUsage is a bad invocation: unknown command or flag, or a missing // required flag. The process exits 2. ReasonUsage = "usage_error" // ReasonFatal is a failure before the command could run, such as a config // file that will not load. ReasonFatal = "fatal" // ReasonError is any other failure the CLI cannot name more precisely. ReasonError = "error" // ReasonAPIError is an API answer with no reason that types.Reason lists. The // API's own reasons are the words of types.Reason. ReasonAPIError = "api_error" )
Reasons in the --json error document: why a command failed, as a word that a program matches on; the message beside them can change between releases. The ReasonInvalidRequest group is the API's, which the API names itself.
const ( ExitOK = 0 ExitError = 1 ExitUsage = 2 )
Exit codes shared by every command.
const ( ToneOK = "ok" ToneWarn = "warn" ToneErr = "err" )
The tones of a status word: ok, it needs attention, or it went wrong.
const HeadingLink = "#"
HeadingLink is the header that Link gets for the text of a heading, so a heading such as the command of a section can link to its page.
Variables ¶
var ( LogoGray = lipgloss.Color("#8a8a8a") LogoCyan = lipgloss.Color("#00d5ff") LogoGreen = lipgloss.Color("#45ae17") LogoYellow = lipgloss.Color("#ffd100") LogoMagenta = lipgloss.Color("#ff00ff") LogoBlue = lipgloss.Color("#2300fd") // LogoBlueFaint is the logo's blue at 25% opacity over a dark terminal. LogoBlueFaint = lipgloss.Color("#120c4c") // LogoBlueText is the logo's blue lifted to read as text on a dark // terminal. The logo's own #2300fd is nearly invisible on black. LogoBlueText = lipgloss.Color("#6b5cff") )
The web UI copies these colors as tokens in ui/src/index.css, and the specs' ui.md and cli.md hold the rules for both. Change a color in both.
The logo palette, from asset/logo-dark.svg. The banner is drawn in it and headings take their colors from it, so the CLI reads like the README.
var ( Green = lipgloss.Color("#67ea94") // UI --color-status-ready Yellow = lipgloss.Color("222") // warm amber Red = lipgloss.Color("#ef4444") // UI --color-status-error )
Status colors. They match the web UI, and they mean the same thing in every table, so they do not rotate with the headings.
var ( // HeadingStyle is the base for help section headings and output titles. // Each one takes its color from nextHeadingColor. HeadingStyle = lipgloss.NewStyle().Bold(true) // NameStyle is for what a reader scans for: command and flag names, // table column headers and key-value labels. NameStyle = lipgloss.NewStyle().Bold(true) // ValueStyle is for data. It is the terminal's own color. ValueStyle = lipgloss.NewStyle() // DimStyle is for secondary text. DimStyle = lipgloss.NewStyle().Foreground(LogoGray) // OKStyle, WarnStyle and ErrStyle carry a result's status. OKStyle = lipgloss.NewStyle().Foreground(Green) // URLStyle marks a location a person opens, such as a sub-component's // url in the health output. A color, not an underline: lipgloss // underlines each character with its own escape sequence. URLStyle = lipgloss.NewStyle().Foreground(LogoCyan) WarnStyle = lipgloss.NewStyle().Foreground(Yellow) ErrStyle = lipgloss.NewStyle().Foreground(Red) )
The styles every renderer in this package uses. Colors are defined in this file and nowhere else.
var CountTones = map[string]string{ "completed": ToneOK, "ok": ToneOK, "changed": ToneOK, "failed": ToneErr, "timeout": ToneErr, "dlq": ToneErr, "errors": ToneErr, "submitted": ToneWarn, "pending": ToneWarn, "partial": ToneWarn, "skipped": ToneWarn, }
CountTones maps what a count counts to the tone it takes when above zero. A zero is dim whatever it counts: nothing happened. A kind not here is plain. The UI reads the same map, from the catalog endpoint.
var StatusTones = map[string]string{ "ok": ToneOK, "ready": ToneOK, "changed": ToneOK, "completed": ToneOK, "running": ToneOK, "healthy": ToneOK, "active": ToneOK, "enabled": ToneOK, "admitted": ToneOK, "skipped": ToneWarn, "disabled": ToneWarn, "draining": ToneWarn, "drained": ToneWarn, "cordoned": ToneWarn, "pending": ToneWarn, "submitted": ToneWarn, "partial": ToneWarn, "partial_failure": ToneWarn, "degraded": ToneWarn, "unknown": ToneWarn, "err": ToneErr, "error": ToneErr, "failed": ToneErr, "timeout": ToneErr, "notready": ToneErr, "unhealthy": ToneErr, "rejected": ToneErr, "revoked": ToneErr, "refused": ToneErr, }
StatusTones maps a status word to its tone: green for ok, amber for attention, red for wrong. The word is the first one in the cell, lowercased, so "ok nats://localhost:4222" and "Ready" both match. A word that is not here is plain. The catalog endpoint serves this map to the UI, so a page and a terminal show a word in the same color.
Functions ¶
func APIReason ¶ added in v0.3.0
APIReason is the reason of an API answer that names none, by its status.
func ApplyTheme ¶ added in v0.3.0
ApplyTheme styles help and errors for root and every command under it. The banner is printed above the root's help only. With --json, help is the command described as JSON instead, for an agent to read.
func Banner ¶ added in v0.3.0
Banner draws the README logo one grid row per terminal line, each cell two columns of full block. A terminal cell is about twice as tall as it is wide, so two columns make a square, as in the SVG. Without color it returns nothing, because the logo is only shape and color.
func Capture ¶ added in v0.3.0
func Capture( fn func(), ) string
Capture runs fn with stdout redirected and color forced on, and returns what it printed with the theme's escape codes intact. The heading colors start from the palette's own order rather than the run's shuffle, so the same output captures the same way every time. The docs generator uses it to put the terminal's exact output on a page.
func DocsPaletteCSS ¶ added in v0.3.0
func DocsPaletteCSS() string
DocsPaletteCSS is the palette as CSS variables for the docs site's stylesheet: the light page's on :root and the dark page's under [data-theme='dark']. go generate ./internal/behaviors/all writes it to DocsPaletteCSSFile, and a test fails when the file is stale.
func DocsPaletteTS ¶ added in v0.3.0
func DocsPaletteTS() string
DocsPaletteTS is the palette as TypeScript, for the docs site's code blocks: docusaurus.config.ts builds its Prism themes from it. go generate ./internal/behaviors/all writes it to DocsPaletteTSFile, and a test fails when the file is stale.
func ExitCode ¶ added in v0.3.0
ExitCode is the process exit code for err: 2 for a usage error, 1 for any other failure.
func Flags ¶ added in v0.3.0
Flags bolds the flag names in a pflag usage block and mutes their types.
func FlushKV ¶ added in v0.3.0
func FlushKV()
FlushKV prints the pending key-value block. Every other printer calls it first, and cmd's Execute calls it when a command returns, so a block always prints before whatever follows it.
func FlushTraceID ¶ added in v0.3.0
func FlushTraceID()
FlushTraceID prints the trace a command's result came from, when no summary line printed it: a table whose rows are not per-host results, such as the agent list, has no summary line. Each command that has a trace thus prints it, as its last line, in gray. --json prints nothing here; the trace is in the traceresponse header.
func FormatAge ¶
FormatAge formats a duration as a human-readable age string. Returns "3d 4h", "12h 30m", "45m", "30s" etc.
func FormatBytes ¶
FormatBytes formats a byte count as a human-readable string (e.g., "5.2 KB", "1.0 MB").
func FormatDuration ¶ added in v0.3.0
FormatDuration rounds a Go duration string to what a reader can use: 6.168625ms is 6ms, 1.234567s is 1.2s, 184s is 3m4s. A value that does not parse is returned as it is.
func GuardGroups ¶ added in v0.3.0
GuardGroups makes every command that only groups others reject a word it does not know. Cobra checks for an unknown subcommand only at the root; below it, a group given one prints its help and exits 0, so a typo such as `osapi config lst` looks like success. A group run bare still prints its help. Call it once every command is added.
func HandleError ¶
HandleError reports err and exits 1: one line for a person, or under --json the error document with the API's status code named.
func HelpJSON ¶ added in v0.3.0
HelpJSON describes c as JSON: its flags, which are required, and its subcommands. For the root command the description also carries the error and exit-code contract every command shares.
func IsOSFamilySupported ¶
IsOSFamilySupported checks if the given distribution and version belong to a supported OS family. Returns the family name and true if supported.
func IsUsageError ¶ added in v0.3.0
IsUsageError reports whether err came from how the command was invoked.
func LocalTime ¶ added in v0.3.0
LocalTime renders a time as local "2006-01-02 15:04:05", the one format human output uses, whatever zone the time came in.
func LogFatal ¶
LogFatal logs a fatal error message along with optional structured data and then exits the program with a status code of 1.
func LogHandler ¶ added in v0.3.0
LogHandler is the handler that a process logs through, to w. With --json, each line is a JSON object. Else each line is the time, the level, the message and the attributes, with the level in color when color is true. Either way it logs at level or above; a *slog.LevelVar changes that while the process runs. The root gives it stderr; the docs generator gives it a buffer with color on, so a page shows the lines that a terminal shows.
func Plain ¶ added in v0.3.0
Plain makes a description from the docs site fit a terminal. A link becomes its text, the marks of code and bold go, and each paragraph wraps again to helpWidth.
func PrintBlock ¶ added in v0.3.0
PrintBlock prints one block of a list of blocks under the current heading: title in bold, then each pair, a label and a text, wrapped and indented under it. A pair with a label prints "Label: text" in gray; a pair with none is the text alone. A blank line goes between two blocks, and none after the heading.
func PrintCompactTable ¶
func PrintCompactTable( sections []Section, )
PrintCompactTable renders a compact column-aligned table (kubectl-style). Headers are uppercase and bold, data rows are in the value style, with a 2-space indent. Multi-line cell values are flattened to a single line and long values are truncated with an ellipsis.
func PrintError ¶ added in v0.3.0
PrintError writes err for a person: a red cross and the message, then a pointer to the command's help when the invocation itself was wrong. With jsonOutput it writes the JSON error document instead.
func PrintErrors ¶
func PrintErrors( errors []ErrorEntry, )
PrintErrors renders error and skip entries below a table. Errors are red, skips are yellow. Each entry shows hostname and message.
func PrintHeading ¶ added in v0.3.0
func PrintHeading( title string, )
PrintHeading prints a section heading the way help prints one: a blank line, then the title and a colon at the left margin in the next logo color, with the block it heads indented under it.
func PrintJSON ¶ added in v0.3.0
func PrintJSON( body []byte, )
PrintJSON prints a response body as it came from the API, for --json.
func PrintJobID ¶ added in v0.3.0
func PrintJobID( id string, )
PrintJobID records the job a command's result came from. The result's summary line ends with it, in gray, rather than it floating above the Results heading.
func PrintKV ¶
func PrintKV( pairs ...string, )
PrintKV adds key-value pairs to the current block. The block prints, one pair per line, a label in the block's tint, a colon, then the value lined up with the others, as soon as anything else prints or the command ends. A Status value takes its status's color.
func PrintTraceID ¶ added in v0.3.0
func PrintTraceID( id string, )
PrintTraceID records the trace of the request that a command's result came from. TraceTransport calls it for each answer, so a command does not. The summary line ends with it, after the job ID; a command with no summary line prints it last, with FlushTraceID, and a command that fails prints it under its error. Search the tracing backend for it to see the request on the controller, the queue and each agent. An empty ID prints nothing.
func RenderStatus ¶ added in v0.3.0
RenderStatus renders a status word, such as "ok" or "disabled", in its status color. A caller that builds a STATUS cell from several styled parts renders the status word with this, because the table does not restyle a cell that already has styling.
func SetHeadingOrder ¶ added in v0.3.0
SetHeadingOrder fixes the heading colors and restarts them, for tests.
func SetJSONOutput ¶ added in v0.3.0
func SetJSONOutput( enabled bool, )
SetJSONOutput records whether --json is in effect.
func TLSTransport ¶ added in v0.3.0
func TLSTransport( c config.ClientTLS, ) (http.RoundTripper, error)
TLSTransport is the transport of the CLI's client, with the TLS config of c: its CA, its client certificate and its server name. With nothing set it is the default transport.
func Usages ¶ added in v0.3.0
Usages is the help of each flag in fs, with each required flag marked (required). Thus a flag says that it is required in one place, the MarkFlagRequired of its command, and not in its own words.
func ValidateDistribution ¶
ValidateDistribution returns an error if the host is not in a supported OS family. IGNORE_LINUX skips the check.
func WriteErrorJSON ¶ added in v0.3.0
func WriteErrorJSON( w io.Writer, doc ErrorDocument, )
WriteErrorJSON writes doc to w as a single line of JSON.
Types ¶
type ErrorDocument ¶ added in v0.3.0
type ErrorDocument struct {
Error string `json:"error"`
Reason string `json:"reason"`
Status int `json:"status,omitempty"`
Details map[string]string `json:"details,omitempty"`
}
ErrorDocument is the one JSON document a failing command writes to stderr under --json.
type ErrorEntry ¶
ErrorEntry is an error or skip reason from a host, rendered below the table.
type HelpCommand ¶ added in v0.3.0
type HelpCommand struct {
Name string `json:"name"`
Path string `json:"path"`
Aliases []string `json:"aliases"`
Description string `json:"description"`
Long string `json:"long,omitempty"`
Usage string `json:"usage"`
Example string `json:"example,omitempty"`
Runnable bool `json:"runnable"`
Flags []HelpFlag `json:"flags"`
Subcommands []HelpSubcommand `json:"subcommands"`
}
HelpCommand is one command in the JSON help. Subcommands are listed by name and description only, so an agent asks for the one it needs next rather than reading the whole tree at once.
type HelpDocument ¶ added in v0.3.0
type HelpDocument struct {
Version string `json:"version"`
Command HelpCommand `json:"command"`
}
HelpDocument is what `osapi help <command> --json` prints.
type HelpFlag ¶ added in v0.3.0
type HelpFlag struct {
Name string `json:"name"`
Shorthand string `json:"shorthand,omitempty"`
Type string `json:"type"`
Default string `json:"default,omitempty"`
Usage string `json:"usage"`
Required bool `json:"required"`
Inherited bool `json:"inherited"`
}
HelpFlag is one flag of a command, local or inherited.
type HelpSubcommand ¶ added in v0.3.0
HelpSubcommand names a subcommand without describing it in full.
type Markdown ¶ added in v0.3.0
type Markdown struct {
// Title, when set, is the text of the first heading, in place of the
// output's own, such as the name of a method for its section.
Title string
// Link, when set, is the page that a cell of a table links to, by its
// column's header and its text, or "" for none: the name of each
// behavior in a list links to its page.
Link func(header string, cell string) string
// contains filtered or unexported fields
}
Markdown prints an output as a page of the docs site: a heading for each block, a table for each key-value block and each table, and a paragraph for each block of text. It writes what the terminal Printer writes, from the same calls, so a page and its command show the same thing.
func (*Markdown) Block ¶ added in v0.3.0
Block prints one item of a list of blocks: its title as a heading, then each pair as a paragraph, "Label: text", or the text alone.
func (*Markdown) KV ¶ added in v0.3.0
KV adds pairs to the key-value block, which prints as a table.
type OSFamily ¶
type OSFamily struct {
// Name is the family name following Ansible conventions (e.g., "Debian", "RedHat").
Name string
// Distributions maps distribution names to their supported versions.
Distributions map[string][]string
}
OSFamily represents a supported OS family with its member distributions.
type Printer ¶ added in v0.3.0
type Printer struct{}
Printer is the command layer's printer: the output of a method that has no renderer prints through the helpers here, in the one theme.
func (Printer) Block ¶ added in v0.3.0
Block prints one item of a list of blocks: title in the name style, then each pair as a wrapped paragraph under it, "Label: text" muted, or the text alone for a pair with no label. A blank line goes between blocks.
func (Printer) Status ¶ added in v0.3.0
Status is word in its status color, as RenderStatus renders it.
func (Printer) Table ¶ added in v0.3.0
Table prints t under its heading, as PrintCompactTable does: an empty one says None., then its hint.
func (Printer) Text ¶ added in v0.3.0
Text prints text as it is, with one newline at its end. The text is the whole output, such as a document or a value for a pipe, so no trace line follows it.
type ResultRow ¶
type ResultRow struct {
Hostname string
Status types.RowStatus
Changed *bool
Error *string
Fields []string
}
ResultRow is a per-host result used by BuildBroadcastTable and BuildMutationTable.
type Section ¶
type Section struct {
Title string
Headers []string
Rows [][]string
Errors []ErrorEntry
Duration string // e.g. "286ms" — shown in summary line
// Reference marks a table that is not per-host results, such as a
// behavior's methods, so no host summary line is printed under it.
Reference bool
// Empty is what an empty list says instead of rows: what to do next,
// such as "None. Upload one with osapi client file upload." Defaults to
// "None.".
Empty string
}
Section represents a header with its corresponding rows.
type TableResult ¶
type TableResult struct {
Headers []string
Rows [][]string
Errors []ErrorEntry
}
TableResult holds the output of BuildBroadcastTable / BuildMutationTable.
func BuildBroadcastTable ¶
func BuildBroadcastTable( results []ResultRow, fieldHeaders []string, ) TableResult
BuildBroadcastTable builds a TableResult for a broadcast response. HOSTNAME and STATUS are always shown. Errors are collected for rendering below the table by PrintCompactTable.
func BuildMutationTable ¶
func BuildMutationTable( results []ResultRow, fieldHeaders []string, ) TableResult
BuildMutationTable builds a TableResult for a mutation response. Uses the same unified STATUS column (ok/changed/skipped/err).
type TraceTransport ¶ added in v0.3.0
type TraceTransport struct {
Base http.RoundTripper
}
TraceTransport records the trace of each answer that passes through it, from its traceresponse header, for the command's last line or its error. The CLI gives it to the SDK client, so each command has the trace of its request with no code of its own, also a command that failed.
Source Files
¶
Directories
¶
| Path | Synopsis |
|---|---|
|
Package command is the command layer of the CLI, and the DSL of its local commands.
|
Package command is the command layer of the CLI, and the DSL of its local commands. |
|
gen
Package commandgen writes the cobra commands of a group of the command layer, gen/cli.go: one command for each method, with its help, its flags and its examples, for the local generator, the endpoint generator and the behavior generator alike.
|
Package commandgen writes the cobra commands of a group of the command layer, gen/cli.go: one command for each method, with its help, its flags and its examples, for the local generator, the endpoint generator and the behavior generator alike. |
|
gen/generate
command
Command generate writes the files that come from the local groups: for each group, the cobra commands in gen/cli.go, and internal/cli/commands/all/gen, which registers every group's commands.
|
Command generate writes the files that come from the local groups: for each group, the cobra commands in gen/cli.go, and internal/cli/commands/all/gen, which registers every group's commands. |
|
gen/genfile
Package genfile writes generated files for the local, endpoint and behavior generators alike: it removes the files a run made before, writes each file under the repository's root, and groups a Go file's imports as the repository does.
|
Package genfile writes generated files for the local, endpoint and behavior generators alike: it removes the files a run made before, writes each file under the repository's root, and groups a Go file's imports as the repository does. |
|
mocks
Package mocks is a generated GoMock package.
|
Package mocks is a generated GoMock package. |
|
commands
|
|
|
agentcmd
Package agentcmd is the agent group: osapi agent start, which runs the agent on a managed host.
|
Package agentcmd is the agent group: osapi agent start, which runs the agent on a managed host. |
|
agentcmd/mocks
Package mocks is a generated GoMock package.
|
Package mocks is a generated GoMock package. |
|
agentservice
Package agentservice installs the agent of this host as a service that starts at boot: a systemd unit on Linux, a launch daemon on macOS, with a config that has the join string.
|
Package agentservice installs the agent of this host as a service that starts at boot: a systemd unit on Linux, a launch daemon on macOS, with a config that has the join string. |
|
all
Package all registers every local group, one blank import each.
|
Package all registers every local group, one blank import each. |
|
all/gen
Package gen registers the commands of every local group.
|
Package gen registers the commands of every local group. |
|
behaviordsl
Package behaviordsl is the behavior group: the commands that list, describe, scaffold, teach and check the behaviors of this binary.
|
Package behaviordsl is the behavior group: the commands that list, describe, scaffold, teach and check the behaviors of this binary. |
|
chain
Package chain is the chain group of commands, osapi dsl chain: the behaviors that a behavior calls on the same host, in the same job.
|
Package chain is the chain group of commands, osapi dsl chain: the behaviors that a behavior calls on the same host, in the same job. |
|
clidocs
Package clidocs is the docs group under osapi dsl: osapi dsl docs generate, which writes the generated pages of the docs site.
|
Package clidocs is the docs group under osapi dsl: osapi dsl docs generate, which writes the generated pages of the docs site. |
|
commanddsl
Package commanddsl is the command group under osapi cli: the commands that list, describe, scaffold, teach and check the local groups of the command DSL.
|
Package commanddsl is the command group under osapi cli: the commands that list, describe, scaffold, teach and check the local groups of the command DSL. |
|
config
Package config is the config group: osapi config list, get and validate, which read osapi's settings the way osapi start does.
|
Package config is the config group: osapi config list, get and validate, which read osapi's settings the way osapi start does. |
|
controllercmd
Package controllercmd is the controller group: osapi controller start, which runs the REST API.
|
Package controllercmd is the controller group: osapi controller start, which runs the REST API. |
|
controllercmd/mocks
Package mocks is a generated GoMock package.
|
Package mocks is a generated GoMock package. |
|
endpointdsl
Package endpointdsl is the endpoint group under osapi controller: the commands that list, describe, scaffold, teach and check the endpoint groups of the controller.
|
Package endpointdsl is the endpoint group under osapi controller: the commands that list, describe, scaffold, teach and check the endpoint groups of the controller. |
|
join
Package join is the join group under osapi controller: osapi controller join token create, list and revoke, which make, show and remove the tokens that admit an agent at its join (osapi-io/osapi#1313).
|
Package join is the join group under osapi controller: osapi controller join token create, list and revoke, which make, show and remove the tokens that admit an agent at its join (osapi-io/osapi#1313). |
|
natsauth
Package natsauth is the auth group under osapi nats: osapi nats auth password create and operator create, which make the authentication of a NATS setup for osapi, with a credential for each osapi role (osapi-io/osapi#1420).
|
Package natsauth is the auth group under osapi nats: osapi nats auth password create and operator create, which make the authentication of a NATS setup for osapi, with a credential for each osapi role (osapi-io/osapi#1420). |
|
natsperms
Package natsperms is the permissions group under osapi nats: osapi nats permissions get, which prints the NATS subjects that one osapi process needs, for a NATS server that osapi does not run (osapi-io/osapi#1415).
|
Package natsperms is the permissions group under osapi nats: osapi nats permissions get, which prints the NATS subjects that one osapi process needs, for a NATS server that osapi does not run (osapi-io/osapi#1415). |
|
natsserver
Package natsserver is the flat group under osapi nats: osapi nats start, which runs the embedded NATS server as its own process.
|
Package natsserver is the flat group under osapi nats: osapi nats start, which runs the embedded NATS server as its own process. |
|
natsserver/mocks
Package mocks is a generated GoMock package.
|
Package mocks is a generated GoMock package. |
|
natssetup
Package natssetup is the setup group under osapi nats: osapi nats setup, which creates osapi's streams and buckets on a NATS server that osapi does not run, such as an existing cluster.
|
Package natssetup is the setup group under osapi nats: osapi nats setup, which creates osapi's streams and buckets on a NATS server that osapi does not run, such as an existing cluster. |
|
pkicert
Package pkicert is osapi pki cert: it shows and rotates the TLS certificates that the servers of osapi serve on this host, the self-signed ones that each makes at its first start and a cert_file of the operator.
|
Package pkicert is osapi pki cert: it shows and rotates the TLS certificates that the servers of osapi serve on this host, the self-signed ones that each makes at its first start and a cert_file of the operator. |
|
pkikey
Package pkikey is the key group under osapi pki: osapi pki key list, get, create and rotate, which read, make and rotate the keys of osapi on this host.
|
Package pkikey is the key group under osapi pki: osapi pki key list, get, create and rotate, which read, make and rotate the keys of osapi on this host. |
|
pkilist
Package pkilist is osapi pki list: each key and each certificate of osapi on this host, in one list.
|
Package pkilist is osapi pki list: each key and each certificate of osapi on this host, in one list. |
|
role
Package role is the role group of local commands: osapi controller role list and get, which read the built-in roles and the custom roles of the controller's config, with what each grants.
|
Package role is the role group of local commands: osapi controller role list and get, which read the built-in roles and the custom roles of the controller's config, with what each grants. |
|
role/mocks
Package mocks is a generated GoMock package.
|
Package mocks is a generated GoMock package. |
|
sdk
Package sdk is the sdk group: osapi sdk list, get, spec get and validate, which describe and check the Go SDK in this binary, as each DSL's group does and as osapi agent collector does for gohai's collectors.
|
Package sdk is the sdk group: osapi sdk list, get, spec get and validate, which describe and check the Go SDK in this binary, as each DSL's group does and as osapi agent collector does for gohai's collectors. |
|
skill
Package skill is the skill group: osapi skill list and get, which show the agent skills that this binary has, and osapi skill install, which installs them into a repository.
|
Package skill is the skill group: osapi skill list and get, which show the agent skills that this binary has, and osapi skill install, which installs them into a repository. |
|
startcmd
Package startcmd is the start group: osapi start, which runs the NATS server, the controller and the agent in one process.
|
Package startcmd is the start group: osapi start, which runs the NATS server, the controller and the agent in one process. |
|
token
Package token is the token group of local commands: osapi controller token generate and validate, which sign and read the bearer tokens of the API with the signing key of the controller's config.
|
Package token is the token group of local commands: osapi controller token generate and validate, which sign and read the bearer tokens of the API with the signing key of the controller's config. |
|
token/mocks
Package mocks is a generated GoMock package.
|
Package mocks is a generated GoMock package. |
|
version
Package version is the version group: osapi version, which prints the build of the binary.
|
Package version is the version group: osapi version, which prints the build of the binary. |
|
Command gen writes the docs site's palette from the CLI's colors.
|
Command gen writes the docs site's palette from the CLI's colors. |
|
Package reference writes the CLI reference pages of the docs site from the cobra command tree.
|
Package reference writes the CLI reference pages of the docs site from the cobra command tree. |