cmd

package
v0.21.0 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2025 License: Apache-2.0 Imports: 6 Imported by: 10

Documentation

Index

Constants

View Source
const (
	// EnvPlatformAPI configures the Platform API version.
	EnvPlatformAPI         = "CNB_PLATFORM_API"
	EnvDeprecationMode     = "CNB_DEPRECATION_MODE"
	DefaultDeprecationMode = ModeWarn

	ModeQuiet = "quiet"
	ModeWarn  = "warn"
	ModeError = "error"
)
View Source
const (
	CodeForFailed = 1
	// 2: reserved
	CodeForInvalidArgs = 3

	CodeForIncompatiblePlatformAPI  = 11
	CodeForIncompatibleBuildpackAPI = 12
)

Variables

View Source
var (
	DefaultLogger = log.NewDefaultLogger(Stdout)
	Stdout        = color.NewConsole(os.Stdout)
	Stderr        = color.NewConsole(os.Stderr)
)
View Source
var (
	// Version is the version of the lifecycle and all produced binaries.
	Version = "0.0.0"
	// SCMCommit is the commit information provided by SCM.
	SCMCommit = ""
	// SCMRepository is the source repository.
	SCMRepository = ""
)

The following variables are injected at compile time.

Functions

func DisableColor added in v0.9.2

func DisableColor(noColor bool)

func EnvOrDefault added in v0.9.0

func EnvOrDefault(key string, defaultVal string) string

func Exit

func Exit(err error)

func ExitWithVersion

func ExitWithVersion()

func VerifyBuildpackAPI added in v0.9.0

func VerifyBuildpackAPI(kind, name, requestedVersion string, logger log.Logger) error

VerifyBuildpackAPI given a Buildpack API version and relevant information for logging will error if the requested version is unsupported, and will log a warning, error, or do nothing if the requested version is deprecated, depending on if the configured deprecation mode is "warn", "error", or "silent", respectively.

func VerifyPlatformAPI added in v0.9.0

func VerifyPlatformAPI(requestedVersion string, logger log.Logger) error

VerifyPlatformAPI given a Platform API version and relevant information for logging will error if the requested version is unsupported, and will log a warning, error, or do nothing if the requested version is deprecated, depending on if the configured deprecation mode is "warn", "error", or "silent", respectively.

Types

type BuildpackAPIVerifier added in v0.15.0

type BuildpackAPIVerifier struct{}

func (*BuildpackAPIVerifier) VerifyBuildpackAPI added in v0.15.0

func (v *BuildpackAPIVerifier) VerifyBuildpackAPI(kind, name, requestedVersion string, logger log.Logger) error

VerifyBuildpackAPI given a Buildpack API version and relevant information for logging will error if the requested version is unsupported, and will log a warning, error, or do nothing if the requested version is deprecated, depending on if the configured deprecation mode is "warn", "error", or "silent", respectively.

type ErrorFail

type ErrorFail struct {
	Err    error
	Code   int
	Action []string
}

func FailCode

func FailCode(code int, action ...string) *ErrorFail

func FailErr

func FailErr(err error, action ...string) *ErrorFail

func FailErrCode

func FailErrCode(err error, code int, action ...string) *ErrorFail

func (*ErrorFail) Error

func (e *ErrorFail) Error() string

Directories

Path Synopsis
cli
cli

Jump to

Keyboard shortcuts

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