Documentation
¶
Index ¶
- Constants
- func GetDistillery(cmd *cobra.Command, req Requirements) (d *dis.Distillery, e error)
- func MetaConfigPath() (string, error)
- func ReadBaseDirectory() (value string, err error)
- func SetFlags(cmd *cobra.Command, flags *Flags)
- func SetParameters(cmd *cobra.Command, params *Params)
- func WriteBaseDirectory(dir string) error
- type Flags
- type Params
- type Requirements
Constants ¶
const ( // ExitZero indicates that no error occurred. // It is the zero value of type ExitCode. ExitZero exit.ExitCode = 0 // ExitGeneric indicates a generic error occurred within this invocation. // This typically implies a subcommand-specific behavior wants to return failure to the caller. ExitGeneric exit.ExitCode = 1 // ExitUnknownCommand indicates that the user attempted to call a subcommand that is not defined. ExitUnknownCommand exit.ExitCode = 2 // ExitGeneralArguments indicates that the user attempted to pass invalid general arguments to the program. ExitGeneralArguments exit.ExitCode = 3 // ExitCommandArguments indicates that the user attempted to pass invalid command-specific arguments to a subcommand. ExitCommandArguments exit.ExitCode = 4 // ExitContext indicates an error with the underlying command context. ExitContext exit.ExitCode = 254 // ExitPanic indicates that the go code called panic() inside the execution of the current program. // This typically implies a bug inside a program. ExitPanic exit.ExitCode = 255 )
Variables ¶
This section is empty.
Functions ¶
func GetDistillery ¶
func GetDistillery(cmd *cobra.Command, req Requirements) (d *dis.Distillery, e error)
GetDistillery gets the distillery for the currently running command. SetFlags and SetParameters must have been called.
func MetaConfigPath ¶
MetaConfigPath returns the full path to the MetaConfigPath().
func ReadBaseDirectory ¶
ReadBaseDirectory reads the base deployment directory from the environment. Use ParamsFromEnv to initialize parameters completely.
It does not perform any reading of files.
func SetParameters ¶
SetParameters sets parameters for a cobra command.
func WriteBaseDirectory ¶
WriteBaseDirectory writes the base directory to the environment, or returns an error.
Types ¶
type Params ¶
type Params struct {
ConfigPath string // ConfigPath is the path to the configuration file for the distillery
Context context.Context // Context for the distillery
}
Params are used to initialize the excutable.
func ParamsFromEnv ¶
ParamsFromEnv creates a new set of parameters from the environment. Uses ReadBaseDirectory or falls back to [BaseDirectoryDefault].
type Requirements ¶
type Requirements struct {
// Do we need an installed distillery?
NeedsDistillery bool
// Automatically fail when cgo is enabled?
FailOnCgo bool
}
Requirements are requirements for the WissKI Distillery.