conf

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Viper = viper.New()

Viper 提供Viper单实例使用

Functions

func FlagConfigPath

func FlagConfigPath(path ...string) string

func MarshalToFile

func MarshalToFile(config interface{}, filename string) error

MarshalToFile 结构体生成文件,方便部署等

func PrintJSON

func PrintJSON(config interface{}) (string, error)

PrintJSON 变成JSON字符串 敏感配置请用 null:"" 屏蔽

func ReadConfig

func ReadConfig(filename string, config interface{}) error

ReadConfig 读取配置文件

func UnmarshalDefaultVal

func UnmarshalDefaultVal(config interface{}) error

UnmarshalDefaultVal 结构体 Tag 默认值

Types

This section is empty.

Jump to

Keyboard shortcuts

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