Versions in this module Expand all Collapse all v0 v0.1.1 Sep 25, 2015 v0.1.0 Sep 25, 2015 Changes in this version + var ErrKeyNotFound = errors.New("configr: Key not found") + var ErrNoRegisteredValues = errors.New("configr: No registered values to generate") + var ErrParseHasntBeenCalled = errors.New("configr: Trying to get values before calling Parse()") + var ErrUnknownEncoding = errors.New("configr: Unable to determine file encoding, please set manually") + var SupportedFileExtensions = []string + func AddSource(p Source) + func Bool(key string) (bool, error) + func FilePath() string + func Float64(key string) (float64, error) + func GenerateBlank(e Encoder) ([]byte, error) + func Get(key string) (interface{}, error) + func Int(key string) (int, error) + func Marshal(v interface{}) ([]byte, error) + func MustParse() + func Parse() error + func Parsed() bool + func RegisterKey(name, description string, defaultVal interface{}, validators ...Validator) + func RequireKey(name, description string, validators ...Validator) + func SetConfigr(c *Configr) + func SetEncoding(encoding Encoding) + func SetFilePath(path string) + func String(key string) (string, error) + func Unmarshal() (map[string]interface{}, error) + type Config interface + Bool func(string) (bool, error) + Float64 func(string) (float64, error) + Get func(string) (interface{}, error) + Int func(string) (int, error) + MustParse func() + Parse func() error + Parsed func() bool + String func(string) (string, error) + type Configr struct + func GetConfigr() *Configr + func New() *Configr + func (c *Configr) AddSource(p Source) + func (c *Configr) Bool(key string) (bool, error) + func (c *Configr) Float64(key string) (float64, error) + func (c *Configr) GenerateBlank(e Encoder) ([]byte, error) + func (c *Configr) Get(key string) (interface{}, error) + func (c *Configr) Int(key string) (int, error) + func (c *Configr) MustParse() + func (c *Configr) Parse() error + func (c *Configr) Parsed() bool + func (c *Configr) RegisterKey(name, description string, defaultVal interface{}, validators ...Validator) + func (c *Configr) RequireKey(name, description string, validators ...Validator) + func (c *Configr) SetDescriptionWrapper(wrapper string) + func (c *Configr) SetIsCaseSensitive(isCaseSensitive bool) + func (c *Configr) SetKeyPathDelimeter(delimeter string) + func (c *Configr) String(key string) (string, error) + type Encoder interface + Marshal func(interface{}) ([]byte, error) + type Encoding int + const JSON + const TOML + const Unknown + type ErrRequiredKeysMissing []string + func (e ErrRequiredKeysMissing) Error() string + type FileSource struct + func NewFileSource(filePath string) *FileSource + func (f *FileSource) FilePath() string + func (f *FileSource) Marshal(v interface{}) ([]byte, error) + func (f *FileSource) SetEncoding(encoding Encoding) + func (f *FileSource) SetFilePath(path string) + func (f *FileSource) Unmarshal() (map[string]interface{}, error) + type Manager interface + AddSource func(Source) + GenerateBlank func(Encoder) ([]byte, error) + RegisterKey func(string, string, interface{}, ...Validator) + RequireKey func(string, string, ...Validator) + SetIsCaseSensitive func(bool) + type Source interface + Unmarshal func() (map[string]interface{}, error) + type SourceAdapter func() (map[string]interface{}, error) + func (f SourceAdapter) Unmarshal() (map[string]interface{}, error) + type Validator func(interface{}) error