Documentation
¶
Index ¶
- func ExitOnShow(show root.ShowFuncType, args ...string) bool
- func KCreateSubcommandPreRunE(cmd *cobra.Command, cfg Trackable, show root.ShowFuncType) func(_ *cobra.Command, _ []string) error
- func SetSubcommandDefaults(cmd *cobra.Command, local any, show root.ShowFuncType)
- func SetupLogger(level string) (*logger.Logger, error)
- type CommandPath
- type Context
- type Embedded
- type Handler
- type Input
- type Trackable
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExitOnShow ¶ added in v0.0.13
func ExitOnShow(show root.ShowFuncType, args ...string) bool
func KCreateSubcommandPreRunE ¶ added in v0.0.13
func SetSubcommandDefaults ¶ added in v0.0.13
func SetSubcommandDefaults(cmd *cobra.Command, local any, show root.ShowFuncType)
Types ¶
type CommandPath ¶ added in v0.0.13
type CommandPath []string
func BuildCommandPath ¶ added in v0.0.13
func BuildCommandPath(cmd *cobra.Command) CommandPath
func (CommandPath) Env ¶ added in v0.0.13
func (c CommandPath) Env() iutils.Prefix
func (CommandPath) Section ¶ added in v0.0.13
func (c CommandPath) Section() iutils.Prefix
func (CommandPath) WithoutRoot ¶ added in v0.0.13
func (c CommandPath) WithoutRoot() CommandPath
type Context ¶ added in v0.0.13
type Context struct {
// Config holds a map of the parsed configuration file.
Config *koanfx.Koanf
// DotEnv holds the parsed .env files
DotEnv *env.Env
// Env holds the parsed environment variables.
Env *env.Env
}
Context holds the parsed configuration.
var GlobalContext Context
GlobalContext is a global variable, allowing the root parsed configuration to be accessed from anywhere in the application.
type Embedded ¶ added in v0.0.13
type Embedded struct {
// Defaults to be set for each tool (not flags).
Defaults []byte
// Default list of tools that can be used to either view or dump out.
Tools []byte
// A template for the cleanup script.
Template []byte
}
Embedded holds the embedded files for the application.
type Handler ¶ added in v0.0.13
type Handler struct {
// contains filtered or unexported fields
}
func (*Handler) SetupLogger ¶ added in v0.0.13
type Input ¶ added in v0.0.13
type Input struct {
// Global contains the global configuration.
Global *root.Config
// Embedded contains the embedded configuration.
Embedded *Embedded
// Cmd is the current command being executed.
Cmd *cobra.Command
// Args are the arguments passed to the command.
Args []string
}
Input is the input structure for the CLI commands.
Click to show internal directories.
Click to hide internal directories.