Documentation
¶
Index ¶
- Variables
- func Execute(build ...BuildInfo) error
- func ExecuteContext(ctx context.Context, deps Dependencies, info BuildInfo, args []string) error
- func ExitCode(err error) int
- func NewRootCommand(deps Dependencies, info BuildInfo) *cobra.Command
- func RenderHello(info BuildInfo, latestVersion string, hasUpdate bool, useColor bool) string
- func RenderHelpDocs(command *cobra.Command)
- func RenderHelpTree(command *cobra.Command, maxDepth int, showGlobalFlags bool)
- func WriteFinalRecovery(err error, out io.Writer) bool
- type BuildInfo
- type Dependencies
Constants ¶
This section is empty.
Variables ¶
View Source
var Version = "dev"
Version remains only as a compatibility fallback for older build scripts. New release builds inject main.version and pass it through BuildInfo.
Functions ¶
func Execute ¶
Execute builds a fresh command tree on every call. main should handle the returned error and map it to a process exit code.
func ExecuteContext ¶
func NewRootCommand ¶
func NewRootCommand(deps Dependencies, info BuildInfo) *cobra.Command
func RenderHello ¶
RenderHello returns the complete hello window as a string, without a trailing newline. The caller is responsible for writing it.
func RenderHelpDocs ¶
func RenderHelpTree ¶
Types ¶
type Dependencies ¶
type Dependencies struct {
In io.Reader
Out io.Writer
Err io.Writer
Getwd func() (string, error)
HomeDir func() (string, error)
Runner versioning.Runner
HookRunner hooks.CommandRunner
HTTPClient *http.Client
Now func() time.Time
Executable func() (string, error)
ReadUpdateNotice func(string, time.Time) string
LaunchUpdate func(string, string) error
ConsumeUpgrade func() (*updater.Completion, error)
ReconcileUpgrade func(string) error
ReconcileBinary func(string, string) error
BootstrapAgents func(string) error
IsTerminal func() bool
}
Click to show internal directories.
Click to hide internal directories.