Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // 设置配置文件改变时的处理函数 OnConfigChange = viper.OnConfigChange // starts watching a config file for changes // 不会阻塞 WatchConfig = viper.WatchConfig )
Functions ¶
func UnmarshalB ¶
UnmarshalB 加载配置字节串到结构体 自动加载环境变量 t是格式类型 yaml s是结构体指针,标签用mapstructure
func UnmarshalEnv ¶
UnmarshalEnv 加载配置文件到结构体 自动加载环境变量 f是配置文件路径 t是文件类型 yaml s是结构体指针,标签用mapstructure
func UnmarshalWatch ¶
UnmarshalWatch 加载配置文件到 s,并监听文件变动,同步到 s s 是结构体指针,标签用 mapstructure
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.