Documentation ¶
Index ¶
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 ReadYamlConfig ¶
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.