Documentation ¶
Index ¶
- func IsProd() bool
- func JSONToString(in interface{}, pretty bool) string
- func LoadSectionTo(runMode, sectionKeyPath string, configHolder interface{}) (err error)
- func RunMode(defaultVal ...string) (runMode string)
- func RunModeExt(defaultVal ...string) (runMode string)
- func StringToBool(s string) (ret bool)
- func ToBool(s interface{}) (ret bool)
- func UnescapeUnicode(b []byte) string
- func YamlToString(in interface{}, pretty bool) string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JSONToString ¶
JSONToString convert json object `in` to json text string
func LoadSectionTo ¶
LoadSectionTo returns error while cannot yaml Marshal and Unmarshal
func RunModeExt ¶
RunModeExt return running mode and position: prod-newwork, devel-paris, staging, ...
func StringToBool ¶
StringToBool parses the string to bool type. these strings will be scanned as true: "1", "y", "t", "yes", "true", "ok", "on"
func ToBool ¶
func ToBool(s interface{}) (ret bool)
ToBool parses the string to bool type. these strings will be scanned as true: "1", "y", "t", "yes", "true", "ok", "on"
func UnescapeUnicode ¶
UnescapeUnicode 解码 \uxxxx 为 unicode 字符; 但是输入的 b 应该是 yaml 格式
func YamlToString ¶
YamlToString convert yaml object `in` to yaml text string
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.