Documentation
¶
Overview ¶
Package env provides functions get environment variable infos. get environment variable infos. usage:
env.Info() env.IsLocal() env.IsDev() env.IsProd() env.IsTest() env.IsDocker() env.IsK8s() env.AppRootPath() env.ConfigFileName() env.ConfigFilePath() env.ConfigFilePathAbs()
Index ¶
- func AppRootPath() string
- func GetContextVal(key any) any
- func GetInfo() *info
- func Init() error
- func IsDev() bool
- func IsDocker() bool
- func IsK8s() bool
- func IsLocal() bool
- func IsProd() bool
- func IsTest() bool
- func SetAppRootPath(path string)
- func SetContextVal(key any, value any)
- func Type2String(t Env) string
- type Env
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetContextVal ¶
GetContextVal get env info's context value by key
func SetAppRootPath ¶ added in v1.6.0
func SetAppRootPath(path string)
SetAppRootPath set the app root path
func SetContextVal ¶
SetContextVal set env info's context value
func Type2String ¶
Type2String returns the string representation of the given environment type.
Types ¶
Click to show internal directories.
Click to hide internal directories.