Documentation
¶
Index ¶
- func LoadWithFilePath(path string, config interface{}) error
- func LoadWithReader(reader io.Reader, config interface{}) error
- type Configurator
- func (c *Configurator) Kernel() *viper.Viper
- func (c *Configurator) LoadWithFilePath(path string, config interface{}) error
- func (c *Configurator) LoadWithReader(reader io.Reader, config interface{}) error
- func (c *Configurator) SetConfigType(configType string) *Configurator
- func (c *Configurator) SetTagName(tagName string) *Configurator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadWithFilePath ¶ added in v1.4.6
func LoadWithReader ¶ added in v1.4.6
Types ¶
type Configurator ¶
type Configurator struct {
// contains filtered or unexported fields
}
func New ¶
func New() *Configurator
func SetConfigType ¶ added in v1.4.6
func SetConfigType(configType string) *Configurator
func SetTagName ¶ added in v1.4.6
func SetTagName(tagName string) *Configurator
func (*Configurator) Kernel ¶
func (c *Configurator) Kernel() *viper.Viper
func (*Configurator) LoadWithFilePath ¶ added in v1.4.6
func (c *Configurator) LoadWithFilePath(path string, config interface{}) error
func (*Configurator) LoadWithReader ¶ added in v1.4.6
func (c *Configurator) LoadWithReader(reader io.Reader, config interface{}) error
LoadWithReader need point out the configType, default is json, can use SetConfigType to change
func (*Configurator) SetConfigType ¶ added in v1.4.6
func (c *Configurator) SetConfigType(configType string) *Configurator
func (*Configurator) SetTagName ¶ added in v1.4.6
func (c *Configurator) SetTagName(tagName string) *Configurator
Click to show internal directories.
Click to hide internal directories.