Documentation ¶
Index ¶
- Variables
- func GetEnvString(key string, defaultValue string) string
- func Load(filename string, val interface{}) error
- func LoadJson(filename string, val interface{}) error
- func LoadToml(filename string, val interface{}) error
- func LoadWithType(filename string, cfgType string) (*viper.Viper, error)
- func LoadYaml(filename string, val interface{}) error
- type Config
- func (c *Config) Load(filename string, val interface{}) error
- func (c *Config) LoadJson(filename string, val interface{}) error
- func (c *Config) LoadToml(filename string, val interface{}) error
- func (c *Config) LoadWithType(filename string, cfgType string) (v *viper.Viper, err error)
- func (c *Config) LoadYaml(filename string, val interface{}) error
- type Option
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // conf file type FileTypeYaml = "yaml" FileTypeJson = "json" FileTypeToml = "toml" )
Functions ¶
func GetEnvString ¶
GetEnvString get value from env.
func LoadWithType ¶
LoadWithType load conf by file type.
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
Config conf struct.
func (*Config) LoadWithType ¶
LoadWithType load conf by file type.
Click to show internal directories.
Click to hide internal directories.