Versions in this module Expand all Collapse all v0 v0.0.1 Dec 5, 2020 Changes in this version + var DefaultFmtStyle = "%f" + var ErrDifferentKind = errors.New("different value kind") + var ErrInvalidBool = errors.New("invalid value. Expected true or false") + var NonBindedBool bool = false + var NonBindedFloat float64 = 0.0 + var NonBindedInt int = 0 + var NonBindedString string = "" + func IsBool(s string) bool + type AKind uint8 + const ABool + const AFloat + const AInt + const AString + const Unknown + func (ak AKind) String() string + type Bool struct + func NewBool() *Bool + func (a *Bool) Bind(b *Bool) + func (a *Bool) IsBinded() bool + func (a *Bool) Kind() AKind + func (a *Bool) Parse(s string) error + func (a *Bool) Set(b bool) + func (a *Bool) String() string + func (a *Bool) UnmarshalJSON(buf []byte) error + func (a *Bool) Val() bool + func (a Bool) MarshalJSON() ([]byte, error) + type Config struct + func (c *Config) BindStruct(structAddr interface{}) []error + func (c *Config) BindVar(code string, addr Valuer) error + func (c *Config) Get(code string) (Valuer, bool) + func (c *Config) IsExist(code string) bool + func (c *Config) MustParam(code string, ak AKind) Valuer + func (c *Config) Param(code string, ak AKind) (Valuer, error) + func (c *Config) Walk(f func(code string, v Valuer, init, asked int)) + type ConfigSourcer interface + ApplyTo func(g Configer, overwrite bool) error + type Configer interface + BindStruct func(structAddr interface{}) []error + BindVar func(code string, v Valuer) error + Get func(code string) (Valuer, bool) + IsExist func(code string) bool + MustParam func(code string, ak AKind) Valuer + Param func(code string, ak AKind) (Valuer, error) + Walk func(func(code string, v Valuer, inited, asked int)) + func New() Configer + type Float struct + func NewFloat() *Float + func (a *Float) Bind(to *Float) + func (a *Float) IsBinded() bool + func (a *Float) Kind() AKind + func (a *Float) Parse(s string) error + func (a *Float) Set(f float64) + func (a *Float) String() string + func (a *Float) UnmarshalJSON(buf []byte) error + func (a *Float) Val() float64 + func (a Float) MarshalJSON() ([]byte, error) + type Int struct + func NewInt() *Int + func (a *Int) Bind(to *Int) + func (a *Int) IsBinded() bool + func (a *Int) Kind() AKind + func (a *Int) Parse(s string) error + func (a *Int) Set(i int) + func (a *Int) String() string + func (a *Int) UnmarshalJSON(buf []byte) error + func (a *Int) Val() int + func (a Int) MarshalJSON() ([]byte, error) + type String struct + func NewString() *String + func (a *String) Bind(i *String) + func (a *String) IsBinded() bool + func (a *String) Kind() AKind + func (a *String) Parse(s string) error + func (a *String) Set(s string) + func (a *String) String() string + func (a *String) UnmarshalJSON(buf []byte) error + func (a *String) Val() string + func (a String) MarshalJSON() ([]byte, error) + type Valuer interface + IsBinded func() bool + Kind func() AKind + Parse func(string) error