config

package
v0.0.0-...-2946602 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CONFIG *config

Functions

func InitConfiguration

func InitConfiguration()

InitConfiguration 初始化配置 使用 viper 读取指定路径的指定文件,将内容映射到结构体里

func SaveBookConfig

func SaveBookConfig(value interface{}) error

func SaveConfig deprecated

func SaveConfig(key string, value interface{}) error

SaveConfig 因为 viper.set 不会自动 set json tag 中内容, 所以得自己转换一遍 set 进去 issue: 无法将数组 set 进去

Deprecated: 已弃用

func UnfoldMapToProperties

func UnfoldMapToProperties(val interface{}, prefix string, result map[string]interface{}) error

UnfoldMapToProperties 展开嵌套结构体为 Properties 结构 必须是结构体,否则报错!

func ViperMonitor

func ViperMonitor()

ViperMonitor 使用 viper 监听指定文件

Types

This section is empty.

Jump to

Keyboard shortcuts

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