Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OptionFunc ¶
type OptionFunc func(dir *YamlLoader)
func WithLogFunc ¶
func WithLogFunc(logger logFunc) OptionFunc
type RegisterOptionFunc ¶
type RegisterOptionFunc func(loader *cfgLoader)
func RegErrorOnNoFile ¶
func RegErrorOnNoFile() RegisterOptionFunc
RegErrorOnNoFile if registered file not exist, and no exampleContent provided, return error (i.e., loading failed)
func RegWithExampleContent ¶
func RegWithExampleContent(content string) RegisterOptionFunc
type YamlLoader ¶
type YamlLoader struct {
// contains filtered or unexported fields
}
func NewYamlLoader ¶
func NewYamlLoader(configFolder string, options ...OptionFunc) *YamlLoader
NewYamlLoader creates YamlLoader with configFolder relative path to $Home. If configFolder is empty, the config file would be put under $HOME directly
func (*YamlLoader) LoadAll ¶
func (loader *YamlLoader) LoadAll() error
LoadAll loads all configs registered
func (*YamlLoader) RegisterFile ¶
func (loader *YamlLoader) RegisterFile(filename string, cfg interface{}, options ...RegisterOptionFunc)
Click to show internal directories.
Click to hide internal directories.