cmd

package
v0.7.5 Latest Latest
Warning

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

Go to latest
Published: May 8, 2020 License: Apache-2.0 Imports: 12 Imported by: 10

Documentation

Index

Constants

View Source
const (
	CodeFailed = 1
	// 2: reserved
	CodeInvalidArgs = 3
	// 4: CodeInvalidEnv
	// 5: CodeNotFound
	CodeFailedDetect = 6
	CodeFailedBuild  = 7
	CodeFailedLaunch = 8
	// 9: CodeFailedUpdate
	CodeFailedSave   = 10
	CodeIncompatible = 11
)
View Source
const (
	DefaultLayersDir           = "/layers"
	DefaultAppDir              = "/workspace"
	DefaultBuildpacksDir       = "/cnb/buildpacks"
	DefaultPlatformDir         = "/platform"
	DefaultOrderPath           = "/cnb/order.toml"
	DefaultGroupPath           = "./group.toml"
	DefaultStackPath           = "/cnb/stack.toml"
	DefaultAnalyzedPath        = "./analyzed.toml"
	DefaultPlanPath            = "./plan.toml"
	DefaultProcessType         = "web"
	DefaultLauncherPath        = "/cnb/lifecycle/launcher"
	DefaultLogLevel            = "info"
	DefaultProjectMetadataPath = "./project-metadata.toml"

	EnvLayersDir           = "CNB_LAYERS_DIR"
	EnvAppDir              = "CNB_APP_DIR"
	EnvBuildpacksDir       = "CNB_BUILDPACKS_DIR"
	EnvPlatformDir         = "CNB_PLATFORM_DIR"
	EnvAnalyzedPath        = "CNB_ANALYZED_PATH"
	EnvOrderPath           = "CNB_ORDER_PATH"
	EnvGroupPath           = "CNB_GROUP_PATH"
	EnvStackPath           = "CNB_STACK_PATH"
	EnvPlanPath            = "CNB_PLAN_PATH"
	EnvUseDaemon           = "CNB_USE_DAEMON" // defaults to false
	EnvRunImage            = "CNB_RUN_IMAGE"
	EnvPreviousImage       = "CNB_PREVIOUS_IMAGE"
	EnvCacheImage          = "CNB_CACHE_IMAGE"
	EnvCacheDir            = "CNB_CACHE_DIR"
	EnvLaunchCacheDir      = "CNB_LAUNCH_CACHE_DIR"
	EnvUID                 = "CNB_USER_ID"
	EnvGID                 = "CNB_GROUP_ID"
	EnvRegistryAuth        = "CNB_REGISTRY_AUTH"
	EnvSkipLayers          = "CNB_ANALYZE_SKIP_LAYERS" // defaults to false
	EnvSkipRestore         = "CNB_SKIP_RESTORE"        // defaults to false
	EnvProcessType         = "CNB_PROCESS_TYPE"
	EnvLogLevel            = "CNB_LOG_LEVEL"
	EnvProjectMetadataPath = "CNB_PROJECT_METADATA_PATH"
)

Variables

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 = ""
	// PlatformAPI is the version of the Platform API implemented.
	PlatformAPI = "0.0"
)

The following variables are injected at compile time.

View Source
var (
	Logger = &log.Logger{
		Handler: &handler{
			writer: os.Stdout,
		},
	}
)

Default logger

Functions

func DeprecatedFlagRunImage added in v0.7.0

func DeprecatedFlagRunImage(image *string)

func Exit

func Exit(err error)

func ExitWithVersion

func ExitWithVersion()

func FlagAnalyzedPath

func FlagAnalyzedPath(dir *string)

func FlagAppDir

func FlagAppDir(dir *string)

func FlagBuildpacksDir

func FlagBuildpacksDir(dir *string)

func FlagCacheDir

func FlagCacheDir(dir *string)

func FlagCacheImage

func FlagCacheImage(image *string)

func FlagGID

func FlagGID(gid *int)

func FlagGroupPath

func FlagGroupPath(path *string)

func FlagLaunchCacheDir

func FlagLaunchCacheDir(dir *string)

func FlagLauncherPath

func FlagLauncherPath(path *string)

func FlagLayersDir

func FlagLayersDir(dir *string)

func FlagLogLevel

func FlagLogLevel(level *string)

func FlagOrderPath

func FlagOrderPath(path *string)

func FlagPlanPath

func FlagPlanPath(path *string)

func FlagPlatformDir

func FlagPlatformDir(dir *string)

func FlagPreviousImage added in v0.7.0

func FlagPreviousImage(image *string)

func FlagProcessType added in v0.7.0

func FlagProcessType(processType *string)

func FlagProjectMetadataPath added in v0.7.0

func FlagProjectMetadataPath(projectMetadataPath *string)

func FlagRunImage

func FlagRunImage(image *string)

func FlagSkipLayers

func FlagSkipLayers(skip *bool)

func FlagSkipRestore added in v0.7.0

func FlagSkipRestore(skip *bool)

func FlagStackPath

func FlagStackPath(path *string)

func FlagTags added in v0.7.0

func FlagTags(tags *StringSlice)

func FlagUID

func FlagUID(uid *int)

func FlagUseDaemon

func FlagUseDaemon(use *bool)

func FlagVersion

func FlagVersion(version *bool)

func Run added in v0.7.0

func Run(c Command, asSubcommand bool)

func VerifyCompatibility

func VerifyCompatibility() error

Types

type Command added in v0.7.0

type Command interface {
	Init()
	Args(nargs int, args []string) error
	Privileges() error
	Exec() error
}

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 SetLogLevel

func SetLogLevel(level string) *ErrorFail

func (*ErrorFail) Error

func (e *ErrorFail) Error() string

type StringSlice added in v0.7.0

type StringSlice []string

func (*StringSlice) Set added in v0.7.0

func (s *StringSlice) Set(value string) error

func (*StringSlice) String added in v0.7.0

func (s *StringSlice) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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