Documentation
¶
Index ¶
- func IsProd() bool
- func JSONToString(in interface{}, pretty bool) string
- func LoadSectionTo(runMode, sectionKeyPath string, configHolder interface{}) (err error)
- func ParseJSON(cfg string) (*config.AppConfig, error)
- func ParseJSONFile(filename string) (*config.AppConfig, error)
- func ParseYaml(cfg string) (*config.AppConfig, error)
- func ParseYamlFile(filename string) (*config.AppConfig, error)
- func RenderJSON(cfg interface{}) (string, error)
- func RenderYaml(cfg interface{}) (string, error)
- func RunMode(defaultVal ...string) (runMode string)
- func RunModeExt(defaultVal ...string) (runMode string)
- 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 ¶ added in v1.2.3
JSONToString convert json object `in` to json text string
func LoadSectionTo ¶
LoadSectionTo returns error while cannot yaml Marshal and Unmarshal
func ParseJSONFile ¶ added in v1.2.3
ParseJSONFile reads a JSON configuration from the given filename.
func ParseYamlFile ¶
ParseYamlFile reads a YAML configuration from the given filename.
func RenderJSON ¶ added in v1.2.3
RenderJSON renders a JSON configuration.
func RenderYaml ¶
RenderYaml renders a YAML configuration.
func RunModeExt ¶ added in v1.2.3
RunModeExt return running mode and position: prod-newyork, devel-paris, staging, ...
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.