command

package
v0.0.0-...-3982cbd Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package command implements the top-level `installer` binary, including its subcommands.

Index

Constants

View Source
const (
	ConfigName      = "installer"
	LoggerName      = "INSTALLER"
	DefaultLogLevel = "off"
)

common constants for all the updater subcommands.

Variables

This section is empty.

Functions

func MakeCommand

func MakeCommand(subcommandFactories []SubcommandFactory) *cobra.Command

MakeCommand makes the top-level Cobra command for this app.

Types

type GlobalParams

type GlobalParams struct {
	// ConfFilePath holds the path to the folder containing the configuration
	// file, to allow overrides from the command line
	ConfFilePath string

	// LogFilePath is the path to the log file.
	LogFilePath string

	// PIDFilePath is the path to the pidfile.
	PIDFilePath string

	// AllowNoRoot is a flag to allow running the installer as non-root.
	AllowNoRoot bool

	// NoColor is a flag to disable color output
	NoColor bool
}

GlobalParams contains the values of installer-global Cobra flags.

A pointer to this type is passed to SubcommandFactory's, but its contents are not valid until Cobra calls the subcommand's Run or RunE function.

type SubcommandFactory

type SubcommandFactory func(globalParams *GlobalParams) []*cobra.Command

SubcommandFactory is a callable that will return a slice of subcommands.

Jump to

Keyboard shortcuts

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