vxconf

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsProd

func IsProd() bool

IsProd return true if app is in production mode.

func JSONToString

func JSONToString(in interface{}, pretty bool) string

JSONToString convert json object `in` to json text string

func LoadSectionTo

func LoadSectionTo(runMode, sectionKeyPath string, configHolder interface{}) (err error)

LoadSectionTo returns error while cannot yaml Marshal and Unmarshal

func RunMode

func RunMode(defaultVal ...string) (runMode string)

RunMode return running mode string: prod, devel, staging, ...

func RunModeExt

func RunModeExt(defaultVal ...string) (runMode string)

RunModeExt return running mode and position: prod-newyork, devel-paris, staging, ...

func StringToBool

func StringToBool(s string) (ret bool)

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

func UnescapeUnicode(b []byte) string

UnescapeUnicode 解码 \uxxxx 为 unicode 字符; 但是输入的 b 应该是 yaml 格式

func YamlToString

func YamlToString(in interface{}, pretty bool) string

YamlToString convert yaml object `in` to yaml text string

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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