Documentation ¶
Index ¶
- type ConfigReader
- type ConfigReaderBuilder
- func (b ConfigReaderBuilder) AttachEnvPrefix(appName string) ConfigReaderBuilder
- func (b ConfigReaderBuilder) Build() ConfigReader
- func (b ConfigReaderBuilder) WithConfigFile(configFile string) ConfigReaderBuilder
- func (b ConfigReaderBuilder) WithConfigName(configName string, configPath ...string) ConfigReaderBuilder
- func (b ConfigReaderBuilder) WithFs(fs afero.Fs) ConfigReaderBuilder
- type NilValueError
- type ValueConversionError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConfigReader ¶
type ConfigReader interface { // Get returns an interface{}. // For a specific value use one of the Get____ methods. Get(key string) (interface{}, error) // GetString retrieves the associated key value as a string. GetString(key string) (string, error) // Unmarshal deserializes the loaded cofig into a struct. Unmarshal(config interface{}) error }
ConfigReader lists the methods exposed by ConfigReaderImpl.
type ConfigReaderBuilder ¶
type ConfigReaderBuilder struct {
// contains filtered or unexported fields
}
ConfigReaderBuilder exposes the builder api for configReaderImpl. Use NewConfigReaderBuilder() and AttachEnvPrefix() to build a ConfigReaderBuilder. Follow it up one or more calls to WithConfigFile() and/or WithConfigName() and finally use Build() to build the configReaderImpl.
func NewConfigReaderBuilder ¶
func NewConfigReaderBuilder() ConfigReaderBuilder
NewConfigReaderBuilder builds a new ConfigReaderBuilder.
func (ConfigReaderBuilder) AttachEnvPrefix ¶
func (b ConfigReaderBuilder) AttachEnvPrefix(appName string) ConfigReaderBuilder
AttachEnvPrefix attaches appName as prefix.
func (ConfigReaderBuilder) Build ¶
func (b ConfigReaderBuilder) Build() ConfigReader
Build Builds and returns the ConfigReader.
func (ConfigReaderBuilder) WithConfigFile ¶
func (b ConfigReaderBuilder) WithConfigFile(configFile string) ConfigReaderBuilder
WithConfigFile attaches the passed config file.
func (ConfigReaderBuilder) WithConfigName ¶
func (b ConfigReaderBuilder) WithConfigName(configName string, configPath ...string) ConfigReaderBuilder
WithConfigName attaches the passed config path and name.
func (ConfigReaderBuilder) WithFs ¶
func (b ConfigReaderBuilder) WithFs(fs afero.Fs) ConfigReaderBuilder
WithFs attaches the file system to use.
type NilValueError ¶
type NilValueError struct {
// contains filtered or unexported fields
}
NilValueError is raised when the key value is nil.
func (NilValueError) Error ¶
func (e NilValueError) Error() string
type ValueConversionError ¶
type ValueConversionError struct {
// contains filtered or unexported fields
}
ValueConversionError is raised when the key value is incompatible with the invoked method.
func (ValueConversionError) Error ¶
func (e ValueConversionError) Error() string