package
Version:
v1.3.5
Opens a new window with list of versions in this module.
Published: Sep 14, 2022
License: MIT
Opens a new window with license information.
Imports: 9
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
conf
解析yaml、json、toml配置文件到go struct,结合goctl工具自动生成config.go到指定目录,例如:
goctl covert yaml --file=test.yaml --tags=json --out=/yourProjectName/config。
安装
go get -u github.com/zhufuyi/pkg/conf
使用示例
具体示例看config。
Documentation
¶
func Parse(configFile string, obj interface{}, fs ...func()) error
Parse 解析配置文件到struct,包括yaml、toml、json等文件,如果fs不为空,开启监听配置文件变化
func Show(obj interface{}, keywords ...string)
Show 打印配置信息(去掉敏感信息)
Source Files
¶
Directories
¶
internal
|
|
|
|
|
Click to show internal directories.
Click to hide internal directories.