Documentation ¶
Index ¶
- Variables
- func BuildVipers(filePath string, fileName ...string)
- func CheckToml(configs string)
- func GetEnvConfig(key string) string
- func GetEnvConfigBool(key string) bool
- func GetEnvConfigCastInt(key string) int
- func GetEnvConfigFloat(key string) float64
- func GetEnvConfigInt(key string) int64
- func GetEnvConfigStringSlice(key string) []string
- func MerageConfigToToml(configs string)
- func NewConfig(filePath string, fileName string)
- func NewConfigToToml(configs string)
- type Viper
- func (V *Viper) GetEnvConfig(key string) string
- func (V *Viper) GetEnvConfigBool(key string) bool
- func (V *Viper) GetEnvConfigCastInt(key string) int
- func (V *Viper) GetEnvConfigFloat(key string) float64
- func (V *Viper) GetEnvConfigInt(key string) int64
- func (V *Viper) GetEnvConfigStringSlice(key string) []string
Constants ¶
This section is empty.
Variables ¶
View Source
var C = viper.New()
Functions ¶
func BuildVipers ¶
func GetEnvConfigCastInt ¶
func GetEnvConfigStringSlice ¶
func MerageConfigToToml ¶ added in v1.2.5
func MerageConfigToToml(configs string)
func NewConfigToToml ¶
func NewConfigToToml(configs string)
Types ¶
type Viper ¶
func LoadViperByFilename ¶
func (*Viper) GetEnvConfig ¶
获取配置文件优先获取环境变量(返回string类型)
func (*Viper) GetEnvConfigBool ¶
获取配置文件优先获取环境变量(返回Bool类型)
func (*Viper) GetEnvConfigCastInt ¶
func (*Viper) GetEnvConfigFloat ¶
获取配置文件优先获取环境变量(返回Float类型)
func (*Viper) GetEnvConfigInt ¶
获取配置文件优先获取环境变量(返回int类型)
func (*Viper) GetEnvConfigStringSlice ¶
Click to show internal directories.
Click to hide internal directories.