cmd

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 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"

	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
	EnvUseHelpers        = "CNB_USE_CRED_HELPERS" // defaults to false
	EnvRunImage          = "CNB_RUN_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
	EnvProcessType       = "CNB_PROCESS_TYPE"
	EnvProcessTypeLegacy = "PACK_PROCESS_TYPE" // deprecated
	EnvLogLevel          = "CNB_LOG_LEVEL"
)

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 DockerClient

func DockerClient() (*client.Client, error)

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 FlagRunImage

func FlagRunImage(image *string)

func FlagSkipLayers

func FlagSkipLayers(skip *bool)

func FlagStackPath

func FlagStackPath(path *string)

func FlagUID

func FlagUID(uid *int)

func FlagUseCredHelpers

func FlagUseCredHelpers(use *bool)

func FlagUseDaemon

func FlagUseDaemon(use *bool)

func FlagVersion

func FlagVersion(version *bool)

func VerifyCompatibility

func VerifyCompatibility() error

Types

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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