env

package
v0.0.0-...-6ac6f58 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0, BSD-3-Clause, MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CommonEnvPrefix = "BK_DIST_"

	HostList    = "BOOSTER_HOSTS"
	BoosterType = "BOOSTER_TYPE"
	ProjectID   = "BOOSTER_PROJECT_ID"
	BatchMode   = "BOOSTER_BATCH_MODE"

	KeyExecutorLogLevel                = "LOG_LEVEL"
	KeyExecutorHookPreloadLibraryLinux = "LD_PRELOAD"
	KeyExecutorHookPreloadLibraryMacos = "DYLD_INSERT_LIBRARIES"
	KeyExecutorHookConfigContent       = "HOOK_CONFIG_CONTENT"
	KeyExecutorHookConfigContentRaw    = "HOOK_CONFIG_CONTENT_RAW"
	KeyExecutorControllerScheme        = "CONTROLLER_SCHEME"
	KeyExecutorControllerIP            = "CONTROLLER_IP"
	KeyExecutorControllerPort          = "CONTROLLER_PORT"
	KeyExecutorControllerNoLocal       = "CONTROLLER_NO_LOCAL"
	KeyExecutorControllerWorkID        = "CONTROLLER_WORK_ID"
	KeyExecutorTaskID                  = "TASK_ID"
	KeyExecutorSkipSeparating          = "SKIP_SEPARATING"
	KeyExecutorSkipLocalRetry          = "SKIP_LOCAL_RETRY"
	KeyExecutorIOTimeout               = "IO_TIMEOUT"
	KeyExecutorToolchainPathMap        = "TOOLCHAIN_PATH_MAP"
	KeyExecutorEnableLib               = "ENABLE_LIB"
	KeyExecutorEnableLink              = "ENABLE_LINK"
	KeyExecutorSupportDirectives       = "SUPPORT_DIRECTIVES"
	KeyExecutorPump                    = "PUMP"
	KeyExecutorPumpDisableMacro        = "PUMP_DISABLE_MACRO"
	KeyExecutorPumpIncludeSysHeader    = "PUMP_INCLUDE_SYS_HEADER"
	KeyExecutorPumpCheck               = "PUMP_CHECK"
	KeyExecutorPumpCache               = "PUMP_CACHE"             // cache pump inlude files
	KeyExecutorPumpCacheDir            = "PUMP_CACHE_DIR"         // cache pump inlude files
	KeyExecutorPumpCacheSizeMaxMB      = "PUMP_CACHE_SIZE_MAX_MB" // cache pump inlude files
	KeyExecutorPumpBlackKeys           = "PUMP_BLACK_KEYS"
	KeyExecutorPumpMinActionNum        = "PUMP_MIN_ACTION_NUM"
	KeyExecutorPumpDisableStatCache    = "PUMP_DISABLE_STAT_CACHE"
	KeyExecutorPumpSearchLink          = "PUMP_SEARCH_LINK"
	KeyExecutorPumpSearchLinkResult    = "PUMP_SEARCH_LINK_RESULT"
	KeyExecutorPumpLstatByDir          = "PUMP_LSTAT_BY_DIR"
	KeyExecutorForceLocalKeys          = "FORCE_LOCAL_KEYS"
	KeyExecutorEnvProfile              = "ENV_PROFILE"
	KeyExecutorWorkerSideCache         = "WORKER_SIDE_CACHE"
	KeyExecutorLocalRecord             = "LOCAL_RECORD"
	KeyExecutorWriteMemory             = "WRITE_MEMORY"
	KeyExecutorIdleKeepSecs            = "IDLE_KEEP_SECS"
	KeyExecutorTotalActionNum          = "TOTAL_ACTION_NUM"
	KeyExecutorUseWebSocket            = "USE_WEBSOCKET"
	KeyExecutorNewShader               = "NEW_SHADER"

	KeyUserDefinedLogLevel         = "USER_DEFINED_LOG_LEVEL"
	KeyUserDefinedExecutorLogLevel = "USER_DEFINED_EXECUTOR_LOG_LEVEL"
	KeyUserDefinedJobs             = "USER_DEFINED_JOBS"
	KeyUserDefinedMaxJobs          = "USER_DEFINED_MAX_JOBS"
	KeyUserDefinedMaxLocalJobs     = "USER_DEFINED_MAX_LOCAL_JOBS"
	KeyUserDefinedMaxLocalExeJobs  = "USER_DEFINED_MAX_LOCAL_EXE_JOBS"
	KeyUserDefinedMaxLocalPreJobs  = "USER_DEFINED_MAX_LOCAL_PRE_JOBS"
	KeyUserDefinedMaxLocalPostJobs = "USER_DEFINED_MAX_LOCAL_POST_JOBS"
	KeyUserDefinedIOTimeoutSecs    = "USER_DEFINED_IO_TIMEOUT_SECS"
	KeyUserDefinedForceLocalList   = "USER_DEFINED_FORCE_LOCAL_LIST"

	KeyCommonCheckMd5      = "CHECK_MD5"
	KeyCommonUE4MaxProcess = "UE4_MAX_PROCESS"
	// for ubt tool
	KeyCommonUE4MaxJobs = "UE4_MAX_JOBS"

	KeyWorkerPort           = "PORT_4_WORKER"        // port for worker,default is 30811
	KeyWorkerMaxProcess     = "MAX_PROCESS_4_WORKER" // max process number, default is 8
	KeyWorkerMaxJobs        = "MAX_JOBS_4_WORKER"    // max parallel jobs
	KeyWorkerWhiteIP        = "WHITE_IP"             // such as "192.168.0.1 192.168.0.2 192.168.0.3 0.0.0.0"
	KeyWorkerCacheEnable    = "CACHE_ENABLE"
	KeyWorkerCacheDir       = "CACHE_DIR"
	KeyWorkerCachePoolSize  = "CACHE_POOL_SIZE"
	KeyWorkerCacheMinSize   = "CACHE_MIN_SIZE"
	KeyWorkerMemPerJob      = "MEM_PER_JOB_4_WORKER" // memory per job
	KeyWorkerSupportAbsPath = "SUPPORT_ABS_PATH"     // whether support abs path

	KeyCustomSetting = "CUSTOM_SETTINGS"

	CommonBKEnvSepKey = "!!|!!"

	KeyRemoteEnvAppend    = "REMOTE_ENV_APPEND"
	KeyRemoteEnvOverwrite = "REMOTE_ENV_OVERWRITE"
)

define const string

Variables

This section is empty.

Functions

func GetEnv

func GetEnv(key string) string

GetEnv get env

func GetEnvKey

func GetEnvKey(key string) string

GetEnvKey return env value by specified key

func SetEnv

func SetEnv(key, value string) error

SetEnv set env

func UnsetEnv

func UnsetEnv(key string) error

UnsetEnv unset env

Types

type Sandbox

type Sandbox struct {
	// contains filtered or unexported fields
}

Sandbox provide a handler to handle the environments variables

func NewSandbox

func NewSandbox(env []string) *Sandbox

NewSandbox get a new sandbox

func (*Sandbox) GetEnv

func (sb *Sandbox) GetEnv(key string) string

GetEnv receive the key and get the real key in bk-dist environment, then return the value

func (*Sandbox) GetOriginEnv

func (sb *Sandbox) GetOriginEnv(key string) string

GetOriginEnv receive the key and return the value

func (*Sandbox) IsSet

func (sb *Sandbox) IsSet(key string) bool

IsSet check the bool key is set in current environments

func (*Sandbox) Source

func (sb *Sandbox) Source() []string

Source return the source env, generated as a slice, each item is the format as "a=b"

Jump to

Keyboard shortcuts

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