Versions in this module Expand all Collapse all v0 v0.21.18 Oct 13, 2021 v0.21.17 Sep 16, 2021 Changes in this version + var ErrInvalidFilePath = errors.New("invalid file path") + var ErrInvalidKey = errors.New("invalid key") + var ErrNotMap = errors.New("interface is not a map") + var ErrNotSupportedReaderType = errors.New("not supported reader type") + var ErrUnknownSuffixes = errors.New("unknown file with suffix") + func DeepCopy(value interface{}) interface + func ParseJSONConfig(data []byte, model interface{}) error + func ParseXMLConfig(data []byte, model interface{}) error + func ParseYAMLConfig(data []byte, model interface{}) error + func ReadJSONFile(filepath string, model interface{}) error + func ReadXMLFile(name string) ([]byte, error) + func ReadYAMLFile(name string) ([]byte, error) + type AdapterConfig struct + ConfigFile string + ConfigString string + ConfigStruct interface{} + EnvAllowed bool + EnvPrefix string + func (p *AdapterConfig) Copy() Config + func (p *AdapterConfig) Dump() (bs []byte, err error) + func (p *AdapterConfig) GetBoolean(key string, defValue ...bool) (b bool) + func (p *AdapterConfig) GetBooleanList(key string) []bool + func (p *AdapterConfig) GetByteSize(key string, defValue ...*big.Int) *big.Int + func (p *AdapterConfig) GetConfig(key string) Config + func (p *AdapterConfig) GetFloat(key string, defValue ...float64) (res float64) + func (p *AdapterConfig) GetFloatList(key string) []float64 + func (p *AdapterConfig) GetInt(key string, defValue ...int) (res int) + func (p *AdapterConfig) GetIntList(key string) []int + func (p *AdapterConfig) GetInterface(key string, defValue ...interface{}) (res interface{}) + func (p *AdapterConfig) GetKeyValue(key string) (vm interface{}, err error) + func (p *AdapterConfig) GetKeys() []string + func (p *AdapterConfig) GetList(key string) (res []interface{}) + func (p *AdapterConfig) GetMap(key string) Options + func (p *AdapterConfig) GetString(key string, defValue ...string) (res string) + func (p *AdapterConfig) GetStringList(key string) []string + func (p *AdapterConfig) GetTimeDuration(key string, defValue ...time.Duration) time.Duration + func (p *AdapterConfig) GetValuesConfig(key string) Config + func (p *AdapterConfig) SetKeyValue(key string, value interface{}) (err error) + func (p *AdapterConfig) ToObject(key string, model interface{}) (err error) + type Config interface + Copy func() Config + Dump func() (bs []byte, err error) + GetBoolean func(key string, defValue ...bool) (b bool) + GetBooleanList func(key string) []bool + GetByteSize func(key string, defValue ...*big.Int) *big.Int + GetConfig func(key string) Config + GetFloat func(key string, defValue ...float64) (res float64) + GetFloatList func(key string) []float64 + GetInt func(key string, defValue ...int) (res int) + GetIntList func(key string) []int + GetInterface func(key string, defValue ...interface{}) (res interface{}) + GetKeys func() []string + GetList func(key string) (res []interface{}) + GetMap func(key string) Options + GetString func(key string, defValue ...string) (res string) + GetStringList func(key string) []string + GetTimeDuration func(key string, defValue ...time.Duration) time.Duration + GetValuesConfig func(key string) Config + SetKeyValue func(key string, value interface{}) (err error) + ToObject func(key string, model interface{}) error + func NewAdapterConfig(filepath string) (Config, error) + func NewConfig(name string) (Config, error) + func NewConfigOptions(opts ...OptionFunc) (Config, error) + type OptionFunc func(*AdapterConfig) + func OptionENVAllowed() OptionFunc + func OptionENVPrefix(prefix string) OptionFunc + func OptionFile(filename string) OptionFunc + func OptionString(rt ReaderType, cStr string) OptionFunc + func OptionStruct(rt ReaderType, st interface{}) OptionFunc + type Options map[string]interface + func (p *Options) ToConfig(rts ...ReaderType) Config + type Reader interface + Dump func(model interface{}) ([]byte, error) + ParseData func(data []byte, model interface{}) error + Read func(model interface{}) error + func NewJSONReader(opts ...ReaderOptionFunc) Reader + func NewReader(rt ReaderType, filename string) (Reader, error) + func NewSuffixReader(opts ...ReaderOptionFunc) (reader Reader, err error) + func NewXMLReader(opts ...ReaderOptionFunc) Reader + func NewYAMLReader(opts ...ReaderOptionFunc) Reader + type ReaderOptionFunc func(*ReaderOptions) + func ReaderOptionFilename(filename string) ReaderOptionFunc + type ReaderOptions struct + type ReaderType int + const ReaderTypeJSON + const ReaderTypeSuffix + const ReaderTypeXML + const ReaderTypeYAML