Documentation ¶
Index ¶
- Constants
- func AppVersion() string
- func BuildTime() string
- func DeployColor() string
- func DeployEnvironment() string
- func Env(name string) string
- func EnvInt(name string) (int, bool)
- func GetEnvKey(env string) string
- func GitCommit() string
- func GitTag() string
- func GoVersion() string
- func HostID() int
- func Hostname() string
- func IntEnvOr(key string, defaultValue int) int
- func IsDev() bool
- func IsProduction() bool
- func IsStaging() bool
- func IsTest() bool
- func StartTime() string
- func StringEnvOr(key string, defaultValue string) string
- func WorkDir() string
Constants ¶
View Source
const ( NextEnvPrefix = "NEXT_" HostIDKey = "HOST_ID" HostnameKey = "HOST_NAME" WorkPathKey = "WORK_PATH" DeployColorKey = "DEPLOY_COLOR" DeployEnvironmentKey = "DEPLOY_ENV" )
View Source
const ( Dev = "dev" // 开发环境 Test = "testing" // 环境环境 Staging = "staging" // 预发环境 Production = "production" // 线上环境 )
Variables ¶
This section is empty.
Functions ¶
func DeployColor ¶
func DeployColor() string
DeployColor is the identification of different experimental group in one caster cluster.
func IntEnvOr ¶
IntEnvOr returns the int value of the environment variable with name key if it exists and the value is an int. Otherwise, defaultValue is returned.
func StringEnvOr ¶
StringEnvOr returns the string value of the environment variable with name key if it exists and the value is an string. Otherwise, defaultValue is returned.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.