cmd

package
v1.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2026 License: MIT Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute() error

func ExecuteContext added in v1.3.0

func ExecuteContext(ctx context.Context) error

ExecuteContext runs the root command with ctx wired through to every subcommand's RunE via cmd.Context(). main.go installs a signal-cancelled context here so Ctrl+C reaches into long-running analyze paths (image pulls, exports) instead of waiting for them to return.

func SetVersionInfo

func SetVersionInfo(v, c, d string)

func StarterConfig added in v1.3.0

func StarterConfig(flavour string) ([]byte, bool)

StarterConfig returns the embedded starter config bytes for the named flavour. The boolean is false if the flavour isn't one of the supported values. Callers should validate flavour before calling, but the boolean keeps a typo from causing a nil-byte write to .layerx.yaml.

Types

type ErrBuildFailed added in v1.4.1

type ErrBuildFailed struct {
	ExitCode int
}

func (*ErrBuildFailed) Error added in v1.4.1

func (e *ErrBuildFailed) Error() string

type ErrCIFailed added in v1.2.2

type ErrCIFailed struct{}

ErrCIFailed signals that one or more CI rules did not pass. main.go maps this sentinel to exit code 1; any other non-nil error returned from cobra exits 2. The report has already been printed to stdout by the time this is returned, so the caller should not print the error message itself.

func (*ErrCIFailed) Error added in v1.2.2

func (e *ErrCIFailed) Error() string

type ErrCIUsage added in v1.4.0

type ErrCIUsage struct{}

ErrCIUsage is returned when the user invoked `layerx ci` with the wrong number of arguments. ciArgs writes a short hint to stderr; the sentinel itself carries no message body so cobra doesn't double-print after it. main.go has no special case for this sentinel, so it exits 2 (operational error), matching ErrCompareUsage.

func (*ErrCIUsage) Error added in v1.4.0

func (e *ErrCIUsage) Error() string

type ErrCompareRegression added in v1.3.0

type ErrCompareRegression struct{}

ErrCompareRegression signals that `layerx compare` detected a regression (efficiency dropped or wasted bytes increased). main.go maps this sentinel to exit code 1; operational errors (resolver failure, daemon down) flow through the normal cobra path and exit 2.

func (*ErrCompareRegression) Error added in v1.3.0

func (e *ErrCompareRegression) Error() string

type ErrCompareUsage added in v1.3.0

type ErrCompareUsage struct{}

ErrCompareUsage is returned when the user invoked `layerx compare` with the wrong number of arguments. The wrapper prints a short hint to stderr; the sentinel itself carries no message body so cobra doesn't double-print.

func (*ErrCompareUsage) Error added in v1.3.0

func (e *ErrCompareUsage) Error() string

Jump to

Keyboard shortcuts

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