Documentation
¶
Overview ¶
Package cli wires together the spec loader, command builder, auth manager, HTTP executor, and output formatters into a single cobra command tree. It is constructed once at program start.
Index ¶
Constants ¶
View Source
const ( ExitOK = 0 ExitError = 1 ExitUsage = 2 )
Exit codes per the spec.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CLI ¶
type CLI struct {
Root *cobra.Command
Config *config.Config
SpecDoc *openapi3.T
SpecPath string
Auth auth.Manager
Executor *client.Executor
Out io.Writer
ErrOut io.Writer
Verbose bool
OutputFmt string
Compact bool
Columns []string
BaseURL string
Timeout time.Duration
Scope []string
ClientID string
ClientSecret string
// Keyring used for auth and setup. Mockable for tests.
Keyring auth.Keyring
// HTTPClient override used by auth/executor (mainly for tests).
HTTPClient *http.Client
}
CLI bundles the runtime components and the assembled cobra root command. A single instance is built by New and shared with the command tree via the CLIRunner interface.
Click to show internal directories.
Click to hide internal directories.