conf

package
v1.3.5 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2022 License: MIT Imports: 9 Imported by: 0

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

Index

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)

Show 打印配置信息(去掉敏感信息)

Types

This section is empty.

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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