Documentation
¶
Overview ¶
Package base defines the core CLI framework, lifecycle hooks, and initialization routines for earth.
Index ¶
- type CLI
- func (c *CLI) AddDeferredFunc(f func())
- func (c *CLI) App() *cli.Command
- func (c *CLI) BuiltBy() string
- func (c *CLI) Cfg() *config.Config
- func (c *CLI) CommandName() string
- func (c *CLI) Console() conslogging.ConsoleLogger
- func (c *CLI) DefaultBuildkitdImage() string
- func (c *CLI) DefaultInstallationName() string
- func (c *CLI) ExecuteDeferredFuncs()
- func (c *CLI) Flags() *flag.Global
- func (cli *CLI) GetBuildkitClient(ctx context.Context, cmd *cli.Command) (c *client.Client, err error)
- func (c *CLI) GitSHA() string
- func (cli *CLI) InitFrontend(_ context.Context, cmd *cli.Command) error
- func (c *CLI) Logbus() *logbus.Bus
- func (c *CLI) LogbusSetup() *setup.BusSetup
- func (c *CLI) SetAction(action cli.ActionFunc)
- func (c *CLI) SetAppStopOnNthArg(stop *int)
- func (c *CLI) SetAppUsage(usage string)
- func (c *CLI) SetAppUsageText(usageText string)
- func (c *CLI) SetAppUseShortOptionHandling(use bool)
- func (c *CLI) SetBefore(before cli.BeforeFunc)
- func (c *CLI) SetCfg(cfg *config.Config)
- func (c *CLI) SetCommandName(commandName string)
- func (c *CLI) SetCommands(commands []*cli.Command)
- func (c *CLI) SetConsole(cons conslogging.ConsoleLogger)
- func (c *CLI) SetFlags(flags []cli.Flag)
- func (c *CLI) SetLogbus(logbus *logbus.Bus)
- func (c *CLI) SetLogbusSetup(setup *setup.BusSetup)
- func (c *CLI) SetVersion(version string)
- func (c *CLI) Version() string
- type CLIOpt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CLI ¶
type CLI struct {
// contains filtered or unexported fields
}
CLI contains the common "earth" command line interface.
func NewCLI ¶
func NewCLI(console conslogging.ConsoleLogger, opts ...CLIOpt) *CLI
NewCLI creates a new CLI.
func (*CLI) AddDeferredFunc ¶
func (c *CLI) AddDeferredFunc(f func())
AddDeferredFunc adds a function to be executed after the app is run.
func (*CLI) Console ¶
func (c *CLI) Console() conslogging.ConsoleLogger
Console returns the console logger.
func (*CLI) DefaultBuildkitdImage ¶
DefaultBuildkitdImage returns the default buildkitd image.
func (*CLI) DefaultInstallationName ¶
DefaultInstallationName returns the default installation name.
func (*CLI) ExecuteDeferredFuncs ¶
func (c *CLI) ExecuteDeferredFuncs()
ExecuteDeferredFuncs executes all deferred functions.
func (*CLI) GetBuildkitClient ¶
func (cli *CLI) GetBuildkitClient(ctx context.Context, cmd *cli.Command) (c *client.Client, err error)
GetBuildkitClient returns a Buildkit client.
func (*CLI) InitFrontend ¶
InitFrontend initializes the frontend for the given command.
func (*CLI) LogbusSetup ¶
LogbusSetup returns the logbus setup.
func (*CLI) SetAction ¶
func (c *CLI) SetAction(action cli.ActionFunc)
SetAction sets the action of the app.
func (*CLI) SetAppStopOnNthArg ¶ added in v0.8.18
SetAppStopOnNthArg tells the cli that it should stop processing flags after the Nth argument.
func (*CLI) SetAppUsage ¶
SetAppUsage sets the usage text of the app.
func (*CLI) SetAppUsageText ¶
SetAppUsageText sets the extended usage text of the app.
func (*CLI) SetAppUseShortOptionHandling ¶
SetAppUseShortOptionHandling sets whether the app should use short option handling.
func (*CLI) SetBefore ¶
func (c *CLI) SetBefore(before cli.BeforeFunc)
SetBefore sets the before function of the app.
func (*CLI) SetCommandName ¶
SetCommandName sets the command name.
func (*CLI) SetCommands ¶
SetCommands sets the subcommands of the app.
func (*CLI) SetConsole ¶
func (c *CLI) SetConsole(cons conslogging.ConsoleLogger)
SetConsole sets the console logger.
func (*CLI) SetLogbusSetup ¶
SetLogbusSetup sets the logbus setup.
func (*CLI) SetVersion ¶
SetVersion sets the version of the app.
type CLIOpt ¶
CLIOpt is a functional option for configuring a CLI.
func WithBuiltBy ¶
WithBuiltBy sets the built by string of the CLI.
func WithDefaultBuildkitdImage ¶
WithDefaultBuildkitdImage sets the default buildkitd image of the CLI.
func WithDefaultInstallationName ¶
WithDefaultInstallationName sets the default installation name of the CLI.