Documentation
¶
Index ¶
- Variables
- func Expand(value string, keyHandles ...func(string) string) string
- func Get(names ...string) string
- func GetBoolVal(val *bool, names ...string)
- func GetFloatVal(val *float64, names ...string)
- func GetIntVal(val *int, names ...string)
- func GetWith(val *string, names ...string)
- func Key(key string) string
- func KeyOf(str ...string) []string
- func List() map[string]string
- func Lookup(key string) (string, bool)
- func Set(key, value string) error
- func UnSetenv(key string) error
Constants ¶
This section is empty.
Variables ¶
View Source
var Cfg = struct { // Prefix 系统环境变量前缀 Prefix string // Separator 分隔符 Separator string }{ Prefix: "", Separator: "_", }
Functions ¶
func Expand ¶
Expand returns value of convert with environment variable. Return environment variable if value start with "${" and end with "}". Return default value if environment variable is empty or not exist.
It accepts value formats "${env}" ,"${env||defaultValue}" , "defaultValue". Examples:
_ = config.Expand("${GOPATH}") _ = config.Expand("${GOPATH||/usr/local/go}") _ = config.Expand("hello")
func GetBoolVal ¶
func GetFloatVal ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.