Documentation
¶
Overview ¶
Package cli defines the cobra commands. Commands only parse flags and call functions in other internal packages; they hold no business logic.
Index ¶
- Constants
- func Execute(ctx context.Context, args []string, s Streams) int
- type App
- type ConfigSetResult
- type ContextList
- type ContextView
- type EndpointView
- type GlobalOptions
- type Plugin
- type PluginListResult
- type SkillContent
- type SkillInstallResult
- type Streams
- type UpgradeResult
- type UserChange
- type UserList
- type UserView
- type Whoami
Constants ¶
const DefaultContextName = "default"
DefaultContextName is the name used by 'config set' without --name.
const DefaultUpTimeout = 10 * time.Minute
DefaultUpTimeout covers the first start, which pulls about 2 GB of images.
const DefaultWorkspaceContext = "local"
DefaultWorkspaceContext is the context name init gives a workspace.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type App ¶
type App struct {
Opts GlobalOptions
Streams Streams
Printer *output.Printer
Log *slog.Logger
// contains filtered or unexported fields
}
App is the state shared by commands during one execution.
func (*App) Interactive ¶
Interactive reports whether commands may prompt the user.
type ConfigSetResult ¶
type ConfigSetResult struct {
Name string `json:"name"`
System string `json:"system"`
URL string `json:"url"`
User string `json:"user"`
Store string `json:"store"`
Current bool `json:"current"`
Verified bool `json:"verified"`
}
ConfigSetResult is the outcome of 'config set'.
type ContextList ¶
type ContextList struct {
Current string `json:"current,omitempty"`
Contexts []ContextView `json:"contexts"`
}
ContextList is the result of 'config list'.
type ContextView ¶
type ContextView struct {
Name string `json:"name"`
Kind string `json:"kind"`
Current bool `json:"current"`
Workspace string `json:"workspace,omitempty"`
Endpoints map[string]EndpointView `json:"endpoints,omitempty"`
}
ContextView is a context as shown by 'config get' and 'config list'.
type EndpointView ¶
type EndpointView struct {
URL string `json:"url"`
Username string `json:"username"`
Insecure bool `json:"insecure,omitempty"`
Password string `json:"password"`
}
EndpointView is an endpoint with its password masked, or shown with --show-secrets.
type GlobalOptions ¶
type GlobalOptions struct {
Output string
Dir string
Context string
NonInteractive bool
Verbose bool
NoColor bool
}
GlobalOptions holds the flags shared by every command.
type Plugin ¶ added in v0.5.0
type Plugin struct {
Name string `json:"name"`
Path string `json:"path"`
// Shadowed is true when a built-in command has the same name, so the plugin never runs.
Shadowed bool `json:"shadowed"`
}
Plugin is one plugin found on PATH.
type PluginListResult ¶ added in v0.5.0
type PluginListResult struct {
Plugins []Plugin `json:"plugins"`
}
PluginListResult is the outcome of 'plugin list'.
type SkillContent ¶ added in v0.4.0
SkillContent is the result of 'skill show'. The text output is the file itself.
type SkillInstallResult ¶ added in v0.4.0
SkillInstallResult is the outcome of 'skill install'.
type UpgradeResult ¶
type UpgradeResult struct {
From string `json:"from"`
To string `json:"to"`
Status stack.Status `json:"status"`
SmokeTest *smoke.Report `json:"smokeTest,omitempty"`
}
UpgradeResult is the outcome of 'upgrade'.
type UserChange ¶
type UserChange struct {
Action string `json:"action"`
Username string `json:"username"`
// Restart is true: OpenArch reads the users file only at startup.
Restart bool `json:"restartNeeded"`
}
UserChange is the result of 'users add', 'set-password' and 'delete'.
type UserList ¶
type UserList struct {
Users []UserView `json:"users"`
}
UserList is the result of 'users list'.
type UserView ¶
type UserView struct {
Username string `json:"username"`
ID string `json:"id"`
Admin bool `json:"admin"`
Groups []string `json:"groups"`
Email string `json:"email,omitempty"`
FirstName string `json:"firstName,omitempty"`
LastName string `json:"lastName,omitempty"`
// Workspace marks the admin user of the workspace, whose password is in .env.local.
Workspace bool `json:"workspaceAdmin,omitempty"`
}
UserView is a user as shown by the users commands. It never has the password.
type Whoami ¶
type Whoami struct {
Context string `json:"context,omitempty"`
Workspace string `json:"workspace,omitempty"`
URL string `json:"url"`
User string `json:"user"`
HasPassword bool `json:"hasPassword"`
Insecure bool `json:"insecure,omitempty"`
Sources auth.Sources `json:"sources"`
}
Whoami is the result of 'config whoami'. It never holds a password.