Documentation ¶
Index ¶
Constants ¶
View Source
const ( DefaultProfile = "default" DefaultConfigFormat = "yaml" DefaultConfigPath = "./config" )
Variables ¶
View Source
var ErrFormatNotSupported = errors.New("config format is not supported")
Functions ¶
func MapStructurePlaceholderValueHook ¶
func MapStructurePlaceholderValueHook() mapstructure.DecodeHookFunc
Types ¶
type AppProperties ¶
type AppProperties struct { Name string `default:"unspecified"` Port int `default:"8080"` Path string `default:"/"` }
func NewAppProperties ¶
func NewAppProperties(loader Loader) (*AppProperties, error)
func (AppProperties) Prefix ¶
func (a AppProperties) Prefix() string
type DefaultProfileReader ¶
type DefaultProfileReader struct {
// contains filtered or unexported fields
}
func NewDefaultProfileReader ¶
func NewDefaultProfileReader(scanPaths []string, format string, delim string) (*DefaultProfileReader, error)
type Loader ¶
type Loader interface {
Bind(properties ...Properties) error
}
type ProfileReader ¶
type Properties ¶
type Properties interface {
Prefix() string
}
type PropertiesPostBinding ¶
type PropertiesPostBinding interface {
PostBinding() error
}
type PropertiesPreBinding ¶
type PropertiesPreBinding interface {
PreBinding() error
}
type ViperLoader ¶
type ViperLoader struct {
// contains filtered or unexported fields
}
func (*ViperLoader) Bind ¶
func (l *ViperLoader) Bind(propertiesList ...Properties) error
Click to show internal directories.
Click to hide internal directories.