Documentation ¶
Index ¶
- Variables
- func BuildVipers(filePath string, fileName ...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 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 ¶ added in v1.1.0
func GetEnvConfigCastInt ¶ added in v1.1.0
func GetEnvConfigStringSlice ¶ added in v1.1.0
func NewConfigToToml ¶ added in v1.1.2
func NewConfigToToml(configs string)
Types ¶
type Viper ¶ added in v1.1.0
func LoadViperByFilename ¶ added in v1.1.0
func (*Viper) GetEnvConfig ¶ added in v1.1.0
获取配置文件优先获取环境变量(返回string类型)
func (*Viper) GetEnvConfigBool ¶ added in v1.1.0
获取配置文件优先获取环境变量(返回Bool类型)
func (*Viper) GetEnvConfigCastInt ¶ added in v1.1.0
func (*Viper) GetEnvConfigFloat ¶ added in v1.1.0
获取配置文件优先获取环境变量(返回Float类型)
func (*Viper) GetEnvConfigInt ¶ added in v1.1.0
获取配置文件优先获取环境变量(返回int类型)
func (*Viper) GetEnvConfigStringSlice ¶ added in v1.1.0
Click to show internal directories.
Click to hide internal directories.