Documentation ¶
Index ¶
- func MustToMap(st interface{}) map[string]interface{}
- func ParseReflectTags(rt reflect.Type, tagNames []string) (map[string]maputil.SMap, error)
- func ParseTagValueINI(field, tagStr string) (mp maputil.SMap, err error)
- func ParseTags(v interface{}, tagNames []string) (map[string]maputil.SMap, error)
- func ToMap(st interface{}) map[string]interface{}
- func TryToMap(st interface{}) (map[string]interface{}, error)
- type Aliases
- func (as *Aliases) AddAlias(real, alias string)
- func (as *Aliases) AddAliasMap(alias2real map[string]string)
- func (as *Aliases) AddAliases(real string, aliases []string)
- func (as *Aliases) HasAlias(alias string) bool
- func (as *Aliases) Mapping() map[string]string
- func (as *Aliases) ResolveAlias(alias string) string
- type MapDataStore
- func (md *MapDataStore) BoolVal(key string) bool
- func (md *MapDataStore) Clear()
- func (md *MapDataStore) Data() map[string]interface{}
- func (md *MapDataStore) EnableLock() *MapDataStore
- func (md *MapDataStore) Get(key string) interface{}
- func (md *MapDataStore) GetVal(key string) interface{}
- func (md *MapDataStore) IntVal(key string) int
- func (md *MapDataStore) Len() int
- func (md *MapDataStore) Set(key string, val interface{})
- func (md *MapDataStore) SetData(data map[string]interface{})
- func (md *MapDataStore) SetValue(key string, val interface{})
- func (md *MapDataStore) StrVal(key string) string
- func (md *MapDataStore) String() string
- func (md *MapDataStore) Value(key string) (val interface{}, ok bool)
- type TagParser
- type Value
- func (v Value) Bool() bool
- func (v Value) Float64() float64
- func (v Value) Int() int
- func (v Value) Int64() int64
- func (v Value) IsEmpty() bool
- func (v *Value) Reset()
- func (v *Value) Set(val interface{})
- func (v Value) SplitToInts(sep ...string) (ss []int)
- func (v Value) SplitToStrings(sep ...string) (ss []string)
- func (v Value) String() string
- func (v Value) Strings() (ss []string)
- func (v Value) Val() interface{}
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MustToMap ¶ added in v0.4.2
func MustToMap(st interface{}) map[string]interface{}
MustToMap alis of TryToMap, but will panic on error
func ParseReflectTags ¶ added in v0.3.10
ParseReflectTags parse struct tags info.
func ParseTagValueINI ¶ added in v0.3.13
ParseTagValueINI tag value string. is like INI format data
eg: "name=int0;shorts=i;required=true;desc=int option message"
Types ¶
type Aliases ¶
type Aliases struct { // Checker custom add alias name checker func Checker func(alias string) // should return bool OR error ?? // contains filtered or unexported fields }
Aliases implemented an simple string alias map.
func (*Aliases) AddAliasMap ¶
AddAliasMap to the Aliases
func (*Aliases) AddAliases ¶
AddAliases to the Aliases
func (*Aliases) ResolveAlias ¶
ResolveAlias by given name.
type MapDataStore ¶ added in v0.3.13
MapDataStore struct
func (*MapDataStore) BoolVal ¶ added in v0.5.3
func (md *MapDataStore) BoolVal(key string) bool
BoolVal get from data
func (*MapDataStore) Data ¶ added in v0.3.13
func (md *MapDataStore) Data() map[string]interface{}
Data get all
func (*MapDataStore) EnableLock ¶ added in v0.3.13
func (md *MapDataStore) EnableLock() *MapDataStore
EnableLock for operate data
func (*MapDataStore) Get ¶ added in v0.5.5
func (md *MapDataStore) Get(key string) interface{}
Get val from data
func (*MapDataStore) GetVal ¶ added in v0.5.3
func (md *MapDataStore) GetVal(key string) interface{}
GetVal get from data
func (*MapDataStore) IntVal ¶ added in v0.5.3
func (md *MapDataStore) IntVal(key string) int
IntVal get from data
func (*MapDataStore) Set ¶ added in v0.5.5
func (md *MapDataStore) Set(key string, val interface{})
Set value to data
func (*MapDataStore) SetData ¶ added in v0.3.13
func (md *MapDataStore) SetData(data map[string]interface{})
SetData set all data
func (*MapDataStore) SetValue ¶ added in v0.3.13
func (md *MapDataStore) SetValue(key string, val interface{})
SetValue to data
func (*MapDataStore) StrVal ¶ added in v0.5.3
func (md *MapDataStore) StrVal(key string) string
StrVal get from data
func (*MapDataStore) String ¶ added in v0.5.3
func (md *MapDataStore) String() string
String format data
func (*MapDataStore) Value ¶ added in v0.3.13
func (md *MapDataStore) Value(key string) (val interface{}, ok bool)
Value get from data
type Value ¶ added in v0.5.5
type Value struct {
// V value
V interface{}
}
Value data store
func (Value) SplitToInts ¶ added in v0.5.6
SplitToInts split string value to []int
func (Value) SplitToStrings ¶ added in v0.5.6
SplitToStrings split string value to strings