Documentation ¶
Index ¶
- Constants
- func CheckCreateConfigFile(v *viper.Viper, configFile string) error
- func ReadConfig(v *viper.Viper, r *ViperReader, baseConfigPath string) error
- func ReadFromYamlBytes(buff []byte, config interface{}) error
- func ReadFromYamlFile(configFile string, config interface{}) error
- func ReadYamlConfig(configPath string, configFile string, config interface{}) error
- func ViperFromYamlBytes(buff []byte, config interface{}) (*viper.Viper, error)
- func ViperFromYamlFile(configFile string, config interface{}) (*viper.Viper, error)
- type ViperReader
- type ViperWrapper
Constants ¶
View Source
const (
DEF_CONFIG_PATH string = "./configs"
)
Variables ¶
This section is empty.
Functions ¶
func ReadConfig ¶
func ReadConfig(v *viper.Viper, r *ViperReader, baseConfigPath string) error
func ReadFromYamlBytes ¶ added in v0.0.34
func ReadFromYamlFile ¶ added in v0.0.34
func ReadYamlConfig ¶
func ViperFromYamlBytes ¶ added in v0.0.34
Types ¶
type ViperReader ¶
type ViperReader struct { ConfigPath string // readers can have diff folder Reader io.Reader ConfigFile string Create bool }
func (*ViperReader) GetConfigPath ¶
func (v *ViperReader) GetConfigPath(configPath string) string
type ViperWrapper ¶
type ViperWrapper struct {
// contains filtered or unexported fields
}
func New ¶
func New() *ViperWrapper
func NewByPath ¶
func NewByPath(configPath string) *ViperWrapper
func NewByReaders ¶
func NewByReaders(readers []ViperReader) *ViperWrapper
func (*ViperWrapper) InitViper ¶
func (v *ViperWrapper) InitViper() error
func (*ViperWrapper) UnmarshalViper ¶
func (v *ViperWrapper) UnmarshalViper(config interface{}) error
func (*ViperWrapper) WatchConfig ¶
func (v *ViperWrapper) WatchConfig(config interface{})
only can watch the last file TODO, watch all config files
Click to show internal directories.
Click to hide internal directories.