README ¶ conf 解析yaml、json、toml配置文件到go struct。 使用示例 // 方式一:无监听配置文件 conf := &App{} err := Parse("test.yml", conf) // 方式二:开启监听配置文件 conf := &App{} fs := []func(){ func() { fmt.Println("监听到配置文件有更新") }, } err := Parse("test.yml", conf, fs...) Expand ▾ Collapse ▴ Documentation ¶ Index ¶ func Parse(configFile string, obj interface{}, fs ...func()) error func Show(obj interface{}, keywords ...string) string Constants ¶ This section is empty. Variables ¶ This section is empty. Functions ¶ func Parse ¶ func Parse(configFile string, obj interface{}, fs ...func()) error Parse 解析配置文件到struct,包括yaml、toml、json等文件,如果fs不为空,开启监听配置文件变化 func Show ¶ func Show(obj interface{}, keywords ...string) string Show 打印配置信息(去掉敏感信息) Types ¶ This section is empty. Source Files ¶ View all Source files parse.go Click to show internal directories. Click to hide internal directories.