cli

package
v0.0.0-...-d8aad48 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2025 License: AGPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
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

func MetaConfigPath() (string, error)

MetaConfigPath returns the full path to the MetaConfigPath().

func ReadBaseDirectory

func ReadBaseDirectory() (value string, err error)

ReadBaseDirectory reads the base deployment directory from the environment. Use ParamsFromEnv to initialize parameters completely.

It does not perform any reading of files.

func SetFlags

func SetFlags(cmd *cobra.Command, flags *Flags)

SetFlags sets the value for a cobra command from a set of flags.

func SetParameters

func SetParameters(cmd *cobra.Command, params *Params)

SetParameters sets parameters for a cobra command.

func WriteBaseDirectory

func WriteBaseDirectory(dir string) error

WriteBaseDirectory writes the base directory to the environment, or returns an error.

Types

type Flags

type Flags struct {
	LogLevel         wdlog.Flag
	ConfigPath       string
	InternalInDocker bool
}

Flags are global flags for the wdcli executable.

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

func ParamsFromEnv() (params Params, err error)

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.

Jump to

Keyboard shortcuts

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