Versions in this module Expand all Collapse all v1 v1.0.2 Mar 14, 2024 v1.0.1 Mar 14, 2024 Changes in this version + var InvalidValueTypeError = errors.New("the value is not expected type") + var KeyNotFoundError = errors.New("the key is not found") + func Bool(key string) (bool, error) + func DIY(key string) (interface{}, error) + func DefaultBool(key string, defaultVal bool) bool + func DefaultFloat(key string, defaultVal float64) float64 + func DefaultInt(key string, defaultVal int) int + func DefaultInt64(key string, defaultVal int64) int64 + func DefaultString(key string, defaultVal string) string + func DefaultStrings(key string, defaultVal []string) []string + func ExpandValueEnv(value string) (realValue string) + func ExpandValueEnvForMap(m map[string]interface{}) map[string]interface + func Float(key string) (float64, error) + func GetSection(section string) (map[string]string, error) + func InitGlobalInstance(name string, cfg string) error + func Int(key string) (int, error) + func Int64(key string) (int64, error) + func OnChange(key string, fn func(value string)) + func ParseBool(val interface{}) (value bool, err error) + func Register(name string, adapter Config) + func SaveConfigFile(filename string) error + func Set(key, val string) error + func String(key string) (string, error) + func Strings(key string) ([]string, error) + func ToString(x interface{}) string + func Unmarshaler(prefix string, obj interface{}, opt ...DecodeOption) error + type BaseConfiger struct + func NewBaseConfiger(reader func(ctx context.Context, key string) (string, error)) BaseConfiger + func (*BaseConfiger) OnChange(_ string, _ func(value string)) + func (*BaseConfiger) Sub(string) (Configer, error) + func (c *BaseConfiger) Bool(key string) (bool, error) + func (c *BaseConfiger) DefaultBool(key string, defaultVal bool) bool + func (c *BaseConfiger) DefaultFloat(key string, defaultVal float64) float64 + func (c *BaseConfiger) DefaultInt(key string, defaultVal int) int + func (c *BaseConfiger) DefaultInt64(key string, defaultVal int64) int64 + func (c *BaseConfiger) DefaultString(key string, defaultVal string) string + func (c *BaseConfiger) DefaultStrings(key string, defaultVal []string) []string + func (c *BaseConfiger) Float(key string) (float64, error) + func (c *BaseConfiger) Int(key string) (int, error) + func (c *BaseConfiger) Int64(key string) (int64, error) + func (c *BaseConfiger) String(key string) (string, error) + func (c *BaseConfiger) Strings(key string) ([]string, error) + type Config interface + Parse func(key string) (Configer, error) + ParseData func(data []byte) (Configer, error) + type Configer interface + Bool func(key string) (bool, error) + DIY func(key string) (interface{}, error) + DefaultBool func(key string, defaultVal bool) bool + DefaultFloat func(key string, defaultVal float64) float64 + DefaultInt func(key string, defaultVal int) int + DefaultInt64 func(key string, defaultVal int64) int64 + DefaultString func(key string, defaultVal string) string + DefaultStrings func(key string, defaultVal []string) []string + Float func(key string) (float64, error) + GetSection func(section string) (map[string]string, error) + Int func(key string) (int, error) + Int64 func(key string) (int64, error) + OnChange func(key string, fn func(value string)) + SaveConfigFile func(filename string) error + Set func(key, val string) error + String func(key string) (string, error) + Strings func(key string) ([]string, error) + Sub func(key string) (Configer, error) + Unmarshaler func(prefix string, obj interface{}, opt ...DecodeOption) error + func NewConfig(adapterName, filename string) (Configer, error) + func NewConfigData(adapterName string, data []byte) (Configer, error) + func NewFakeConfig() Configer + func Sub(key string) (Configer, error) + type DecodeOption func(options decodeOptions) + type IniConfig struct + func (ini *IniConfig) Parse(name string) (Configer, error) + func (ini *IniConfig) ParseData(data []byte) (Configer, error) + type IniConfigContainer struct + func (c *IniConfigContainer) Bool(key string) (bool, error) + func (c *IniConfigContainer) DIY(key string) (v interface{}, err error) + func (c *IniConfigContainer) DefaultBool(key string, defaultVal bool) bool + func (c *IniConfigContainer) DefaultFloat(key string, defaultVal float64) float64 + func (c *IniConfigContainer) DefaultInt(key string, defaultVal int) int + func (c *IniConfigContainer) DefaultInt64(key string, defaultVal int64) int64 + func (c *IniConfigContainer) DefaultString(key string, defaultVal string) string + func (c *IniConfigContainer) DefaultStrings(key string, defaultVal []string) []string + func (c *IniConfigContainer) Float(key string) (float64, error) + func (c *IniConfigContainer) GetSection(section string) (map[string]string, error) + func (c *IniConfigContainer) Int(key string) (int, error) + func (c *IniConfigContainer) Int64(key string) (int64, error) + func (c *IniConfigContainer) SaveConfigFile(filename string) (err error) + func (c *IniConfigContainer) Set(key, val string) error + func (c *IniConfigContainer) String(key string) (string, error) + func (c *IniConfigContainer) Strings(key string) ([]string, error) + func (c *IniConfigContainer) Unmarshaler(prefix string, obj interface{}, opt ...DecodeOption) error