Documentation
¶
Index ¶
- Constants
- func Config() *conf.Conf
- func Fr(ctx context.Context, itf interface{}) api.MapInterface
- func FrWithChain(ctx context.Context, itf interface{}, iterChain *IterChain) api.MapInterface
- func From(itf interface{}) api.MapInterface
- type BaseItfImpl
- func (b *BaseItfImpl) Exist(key interface{}) (interface{}, bool)
- func (b *BaseItfImpl) ForEach(forFunc api.ForFunc) api.MapInterface
- func (b *BaseItfImpl) Get(key interface{}) api.MapInterface
- func (b *BaseItfImpl) GetAny(keys ...interface{}) api.MapInterface
- func (b *BaseItfImpl) GetByInterface(key interface{}) (srcVal, itfVal interface{}, err itferr.MapItfErr)
- func (b *BaseItfImpl) Index(index int) api.MapInterface
- func (b *BaseItfImpl) IsDigit() (bool, error)
- func (b *BaseItfImpl) IsDigitList() (bool, error)
- func (b *BaseItfImpl) IsList() (bool, error)
- func (b *BaseItfImpl) IsMap() (bool, error)
- func (b *BaseItfImpl) IsMapStrItf() (bool, error)
- func (b *BaseItfImpl) IsStr() (bool, error)
- func (b *BaseItfImpl) IsStrList() (bool, error)
- func (b *BaseItfImpl) New() api.MapInterface
- func (b *BaseItfImpl) OrgVal() (interface{}, error)
- func (b *BaseItfImpl) PrintPath() string
- func (b *BaseItfImpl) SetAllAsMap() (orgVal interface{}, err error)
- func (b *BaseItfImpl) SetAsMap(key interface{}) (orgVal interface{}, err error)
- func (b *BaseItfImpl) SetMap(key interface{}, val interface{}) (orgVal interface{}, err error)
- func (b *BaseItfImpl) ToBool() (bool, error)
- func (b *BaseItfImpl) ToByte() ([]byte, error)
- func (b *BaseItfImpl) ToFloat32() (float32, error)
- func (b *BaseItfImpl) ToFloat64() (float64, error)
- func (b *BaseItfImpl) ToInt() (int, error)
- func (b *BaseItfImpl) ToInt32() (int32, error)
- func (b *BaseItfImpl) ToInt64() (int64, error)
- func (b *BaseItfImpl) ToList() ([]interface{}, error)
- func (b *BaseItfImpl) ToListBool() ([]bool, error)
- func (b *BaseItfImpl) ToListFloat32() ([]float32, error)
- func (b *BaseItfImpl) ToListFloat64() ([]float64, error)
- func (b *BaseItfImpl) ToListInt() ([]int, error)
- func (b *BaseItfImpl) ToListInt32() ([]int32, error)
- func (b *BaseItfImpl) ToListInt64() ([]int64, error)
- func (b *BaseItfImpl) ToListMap() ([]map[string]interface{}, error)
- func (b *BaseItfImpl) ToListRune() ([]rune, error)
- func (b *BaseItfImpl) ToListStr() ([]string, error)
- func (b *BaseItfImpl) ToListStrF() ([]string, error)
- func (b *BaseItfImpl) ToListUint() ([]uint, error)
- func (b *BaseItfImpl) ToListUint32() ([]uint32, error)
- func (b *BaseItfImpl) ToListUint64() ([]uint64, error)
- func (b *BaseItfImpl) ToMap() (map[string]interface{}, error)
- func (b *BaseItfImpl) ToMapFloat32() (map[float32]interface{}, error)
- func (b *BaseItfImpl) ToMapFloat32ToFloat32() (map[float32]float32, error)
- func (b *BaseItfImpl) ToMapFloat64() (map[float64]interface{}, error)
- func (b *BaseItfImpl) ToMapFloat64ToFloat64() (map[float64]float64, error)
- func (b *BaseItfImpl) ToMapInt() (map[int]interface{}, error)
- func (b *BaseItfImpl) ToMapInt32() (map[int32]interface{}, error)
- func (b *BaseItfImpl) ToMapInt64() (map[int64]interface{}, error)
- func (b *BaseItfImpl) ToMapInt64ToInt64() (map[int64]int64, error)
- func (b *BaseItfImpl) ToMapIntToInt() (map[int]int, error)
- func (b *BaseItfImpl) ToMapItf() (map[interface{}]interface{}, error)
- func (b *BaseItfImpl) ToMapStrToStr() (map[string]string, error)
- func (b *BaseItfImpl) ToMapUint() (map[uint]interface{}, error)
- func (b *BaseItfImpl) ToMapUint32() (map[uint32]interface{}, error)
- func (b *BaseItfImpl) ToMapUint64() (map[uint64]interface{}, error)
- func (b *BaseItfImpl) ToRune() (rune, error)
- func (b *BaseItfImpl) ToStr() (string, error)
- func (b *BaseItfImpl) ToStruct(stc interface{}) (interface{}, error)
- func (b *BaseItfImpl) ToUint() (uint, error)
- func (b *BaseItfImpl) ToUint32() (uint32, error)
- func (b *BaseItfImpl) ToUint64() (uint64, error)
- func (b *BaseItfImpl) Uniq() api.MapInterface
- func (b *BaseItfImpl) Val() (interface{}, error)
- func (b *BaseItfImpl) Valid() bool
- type BasicItf
- type BasicItfImpl
- func (m *BasicItfImpl) Get(key interface{}) api.MapInterface
- func (m *BasicItfImpl) GetAny(keys ...interface{}) api.MapInterface
- func (m *BasicItfImpl) Index(index int) api.MapInterface
- func (m *BasicItfImpl) New() api.MapInterface
- func (m *BasicItfImpl) OrgVal() (interface{}, error)
- func (m *BasicItfImpl) WithIterChain(iterChain *IterChain) BasicItf
- type BasicListItf
- type BasicListItfImpl
- func (m *BasicListItfImpl) Exist(key interface{}) (interface{}, bool)
- func (m *BasicListItfImpl) Get(key interface{}) api.MapInterface
- func (m *BasicListItfImpl) GetAny(keys ...interface{}) api.MapInterface
- func (m *BasicListItfImpl) Index(index int) api.MapInterface
- func (m *BasicListItfImpl) New() api.MapInterface
- func (m *BasicListItfImpl) OrgVal() (interface{}, error)
- func (m *BasicListItfImpl) SetAllAsMap() (orgVal interface{}, err error)
- func (m *BasicListItfImpl) SetAsMap(key interface{}) (orgVal interface{}, err error)
- func (m *BasicListItfImpl) SetMap(key interface{}, val interface{}) (orgVal interface{}, err error)
- func (m *BasicListItfImpl) WithIterChain(iterChain *IterChain) BasicListItf
- type DataType
- type EntranceFuncDefine
- type ExceptItf
- type ExceptItfImpl
- type ForeachItf
- type ForeachItfImpl
- func (m *ForeachItfImpl) ForEach(forFunc api.ForFunc) api.MapInterface
- func (m *ForeachItfImpl) Get(key interface{}) api.MapInterface
- func (m *ForeachItfImpl) GetAny(keys ...interface{}) api.MapInterface
- func (m *ForeachItfImpl) Index(index int) api.MapInterface
- func (m *ForeachItfImpl) IsDigit() (bool, error)
- func (m *ForeachItfImpl) IsDigitList() (bool, error)
- func (m *ForeachItfImpl) IsList() (bool, error)
- func (m *ForeachItfImpl) IsMap() (bool, error)
- func (m *ForeachItfImpl) IsMapStrItf() (bool, error)
- func (m *ForeachItfImpl) IsStr() (bool, error)
- func (m *ForeachItfImpl) IsStrList() (bool, error)
- func (m *ForeachItfImpl) New() api.MapInterface
- func (m *ForeachItfImpl) PrintPath() string
- func (m *ForeachItfImpl) SetAllAsMap() (orgVal interface{}, err error)
- func (m *ForeachItfImpl) SetAsMap(key interface{}) (orgVal interface{}, err error)
- func (m *ForeachItfImpl) SetMap(key interface{}, val interface{}) (orgVal interface{}, err error)
- func (m *ForeachItfImpl) ToList() ([]interface{}, error)
- func (m *ForeachItfImpl) ToListBool() ([]bool, error)
- func (m *ForeachItfImpl) ToListFloat32() ([]float32, error)
- func (m *ForeachItfImpl) ToListFloat64() ([]float64, error)
- func (m *ForeachItfImpl) ToListInt() ([]int, error)
- func (m *ForeachItfImpl) ToListInt32() ([]int32, error)
- func (m *ForeachItfImpl) ToListInt64() ([]int64, error)
- func (m *ForeachItfImpl) ToListMap() ([]map[string]interface{}, error)
- func (m *ForeachItfImpl) ToListRune() ([]int32, error)
- func (m *ForeachItfImpl) ToListStr() ([]string, error)
- func (m *ForeachItfImpl) ToListStrF() ([]string, error)
- func (m *ForeachItfImpl) ToListUint() ([]uint, error)
- func (m *ForeachItfImpl) ToListUint32() ([]uint32, error)
- func (m *ForeachItfImpl) ToListUint64() ([]uint64, error)
- func (m *ForeachItfImpl) ToMap() (map[string]interface{}, error)
- func (m *ForeachItfImpl) ToMapFloat32() (map[float32]interface{}, error)
- func (m *ForeachItfImpl) ToMapFloat32ToFloat32() (map[float32]float32, error)
- func (m *ForeachItfImpl) ToMapFloat64() (map[float64]interface{}, error)
- func (m *ForeachItfImpl) ToMapFloat64ToFloat64() (map[float64]float64, error)
- func (m *ForeachItfImpl) ToMapInt() (map[int]interface{}, error)
- func (m *ForeachItfImpl) ToMapInt32() (map[int32]interface{}, error)
- func (m *ForeachItfImpl) ToMapInt64() (map[int64]interface{}, error)
- func (m *ForeachItfImpl) ToMapInt64ToInt64() (map[int64]int64, error)
- func (m *ForeachItfImpl) ToMapIntToInt() (map[int]int, error)
- func (m *ForeachItfImpl) ToMapItf() (map[interface{}]interface{}, error)
- func (m *ForeachItfImpl) ToMapStrToStr() (map[string]string, error)
- func (m *ForeachItfImpl) ToMapUint() (map[uint]interface{}, error)
- func (m *ForeachItfImpl) ToMapUint32() (map[uint32]interface{}, error)
- func (m *ForeachItfImpl) ToMapUint64() (map[uint64]interface{}, error)
- func (m *ForeachItfImpl) ToStruct(out interface{}) (interface{}, error)
- func (m *ForeachItfImpl) Uniq() api.MapInterface
- func (m *ForeachItfImpl) WithIterChain(iterChain *IterChain) ForeachItf
- type IterChain
- func (i *IterChain) Clone() *IterChain
- func (i *IterChain) HeadVal() interface{}
- func (i *IterChain) PushBack(val interface{})
- func (i *IterChain) PushBackByIdx(idx int, val interface{})
- func (i *IterChain) PushBackByKey(key, val interface{})
- func (i *IterChain) ReplaceBack(val interface{})
- func (i *IterChain) SetBackPreVal(val interface{}) error
- type IterCtx
- type MapAnyToItf
- type MapAnyToItfImpl
- func (m *MapAnyToItfImpl) Get(key interface{}) api.MapInterface
- func (m *MapAnyToItfImpl) GetAny(keys ...interface{}) api.MapInterface
- func (m *MapAnyToItfImpl) New() api.MapInterface
- func (m *MapAnyToItfImpl) OrgVal() (interface{}, error)
- func (m *MapAnyToItfImpl) WithErr(err itferr.MapItfErr) MapAnyToItf
- func (m *MapAnyToItfImpl) WithIterChain(iterChain *IterChain) MapAnyToItf
- type MapListItf
- type MapListItfImpl
- type MapStrItf
- type MapStrItfImpl
- func (m *MapStrItfImpl) Get(key interface{}) api.MapInterface
- func (m *MapStrItfImpl) GetAny(keys ...interface{}) api.MapInterface
- func (m *MapStrItfImpl) GetByPath(keys ...string) (msi MapStrItf)
- func (m *MapStrItfImpl) GetOne(key string) api.MapInterface
- func (m *MapStrItfImpl) New() api.MapInterface
- func (m *MapStrItfImpl) OrgVal() (interface{}, error)
- func (m *MapStrItfImpl) WithErr(err itferr.MapItfErr) MapStrItf
- func (m *MapStrItfImpl) WithIterChain(iterChain *IterChain) MapStrItf
Constants ¶
const ( EmptyDataType = "empty_data" ListDataType = "list" MapDataType = "map" )
Variables ¶
This section is empty.
Functions ¶
func Fr ¶ added in v1.2.1
func Fr(ctx context.Context, itf interface{}) api.MapInterface
Fr 等价于From,携带Context的版本
func FrWithChain ¶ added in v1.2.1
func FrWithChain(ctx context.Context, itf interface{}, iterChain *IterChain) api.MapInterface
func From ¶
func From(itf interface{}) api.MapInterface
-------------------Enter/入口------------------------------------- From 等价于Fr,入口方法
Types ¶
type BaseItfImpl ¶
type BaseItfImpl struct {
Ctx context.Context
Class string
ItfErr itferr.MapItfErr
IterVal interface{}
IterChain *IterChain
}
func (*BaseItfImpl) Exist ¶
func (b *BaseItfImpl) Exist(key interface{}) (interface{}, bool)
func (*BaseItfImpl) ForEach ¶
func (b *BaseItfImpl) ForEach(forFunc api.ForFunc) api.MapInterface
func (*BaseItfImpl) Get ¶
func (b *BaseItfImpl) Get(key interface{}) api.MapInterface
Interface ----------------------------------------------------------------------------------------
func (*BaseItfImpl) GetAny ¶
func (b *BaseItfImpl) GetAny(keys ...interface{}) api.MapInterface
func (*BaseItfImpl) GetByInterface ¶
func (b *BaseItfImpl) GetByInterface(key interface{}) (srcVal, itfVal interface{}, err itferr.MapItfErr)
GetByInterface 如果key的类型和Map[k]v中k类型不一致会panic
func (*BaseItfImpl) Index ¶
func (b *BaseItfImpl) Index(index int) api.MapInterface
func (*BaseItfImpl) IsDigit ¶ added in v1.2.1
func (b *BaseItfImpl) IsDigit() (bool, error)
func (*BaseItfImpl) IsDigitList ¶ added in v1.2.1
func (b *BaseItfImpl) IsDigitList() (bool, error)
func (*BaseItfImpl) IsList ¶ added in v1.2.1
func (b *BaseItfImpl) IsList() (bool, error)
func (*BaseItfImpl) IsMap ¶ added in v1.2.1
func (b *BaseItfImpl) IsMap() (bool, error)
func (*BaseItfImpl) IsMapStrItf ¶ added in v1.2.1
func (b *BaseItfImpl) IsMapStrItf() (bool, error)
func (*BaseItfImpl) IsStr ¶ added in v1.2.1
func (b *BaseItfImpl) IsStr() (bool, error)
OriginTypeChecker ----------------------------------------------------------------------------------------
func (*BaseItfImpl) IsStrList ¶ added in v1.2.1
func (b *BaseItfImpl) IsStrList() (bool, error)
func (*BaseItfImpl) New ¶ added in v1.2.1
func (b *BaseItfImpl) New() api.MapInterface
func (*BaseItfImpl) OrgVal ¶ added in v1.2.1
func (b *BaseItfImpl) OrgVal() (interface{}, error)
func (*BaseItfImpl) PrintPath ¶ added in v1.2.1
func (b *BaseItfImpl) PrintPath() string
func (*BaseItfImpl) SetAllAsMap ¶ added in v1.2.2
func (b *BaseItfImpl) SetAllAsMap() (orgVal interface{}, err error)
func (*BaseItfImpl) SetAsMap ¶ added in v1.2.1
func (b *BaseItfImpl) SetAsMap(key interface{}) (orgVal interface{}, err error)
func (*BaseItfImpl) SetMap ¶ added in v1.2.1
func (b *BaseItfImpl) SetMap(key interface{}, val interface{}) (orgVal interface{}, err error)
func (*BaseItfImpl) ToBool ¶
func (b *BaseItfImpl) ToBool() (bool, error)
func (*BaseItfImpl) ToByte ¶
func (b *BaseItfImpl) ToByte() ([]byte, error)
func (*BaseItfImpl) ToFloat32 ¶
func (b *BaseItfImpl) ToFloat32() (float32, error)
func (*BaseItfImpl) ToFloat64 ¶
func (b *BaseItfImpl) ToFloat64() (float64, error)
func (*BaseItfImpl) ToInt ¶
func (b *BaseItfImpl) ToInt() (int, error)
func (*BaseItfImpl) ToInt32 ¶
func (b *BaseItfImpl) ToInt32() (int32, error)
func (*BaseItfImpl) ToInt64 ¶
func (b *BaseItfImpl) ToInt64() (int64, error)
func (*BaseItfImpl) ToList ¶
func (b *BaseItfImpl) ToList() ([]interface{}, error)
ToArrayType ----------------------------------------------------------------------------------------
func (*BaseItfImpl) ToListBool ¶
func (b *BaseItfImpl) ToListBool() ([]bool, error)
func (*BaseItfImpl) ToListFloat32 ¶
func (b *BaseItfImpl) ToListFloat32() ([]float32, error)
func (*BaseItfImpl) ToListFloat64 ¶
func (b *BaseItfImpl) ToListFloat64() ([]float64, error)
func (*BaseItfImpl) ToListInt ¶
func (b *BaseItfImpl) ToListInt() ([]int, error)
func (*BaseItfImpl) ToListInt32 ¶
func (b *BaseItfImpl) ToListInt32() ([]int32, error)
func (*BaseItfImpl) ToListInt64 ¶
func (b *BaseItfImpl) ToListInt64() ([]int64, error)
func (*BaseItfImpl) ToListMap ¶ added in v1.2.1
func (b *BaseItfImpl) ToListMap() ([]map[string]interface{}, error)
func (*BaseItfImpl) ToListRune ¶ added in v1.2.1
func (b *BaseItfImpl) ToListRune() ([]rune, error)
func (*BaseItfImpl) ToListStr ¶
func (b *BaseItfImpl) ToListStr() ([]string, error)
func (*BaseItfImpl) ToListStrF ¶
func (b *BaseItfImpl) ToListStrF() ([]string, error)
func (*BaseItfImpl) ToListUint ¶
func (b *BaseItfImpl) ToListUint() ([]uint, error)
func (*BaseItfImpl) ToListUint32 ¶
func (b *BaseItfImpl) ToListUint32() ([]uint32, error)
func (*BaseItfImpl) ToListUint64 ¶
func (b *BaseItfImpl) ToListUint64() ([]uint64, error)
func (*BaseItfImpl) ToMap ¶
func (b *BaseItfImpl) ToMap() (map[string]interface{}, error)
ToMapType ----------------------------------------------------------------------------------------
func (*BaseItfImpl) ToMapFloat32 ¶
func (b *BaseItfImpl) ToMapFloat32() (map[float32]interface{}, error)
func (*BaseItfImpl) ToMapFloat32ToFloat32 ¶
func (b *BaseItfImpl) ToMapFloat32ToFloat32() (map[float32]float32, error)
func (*BaseItfImpl) ToMapFloat64 ¶
func (b *BaseItfImpl) ToMapFloat64() (map[float64]interface{}, error)
func (*BaseItfImpl) ToMapFloat64ToFloat64 ¶
func (b *BaseItfImpl) ToMapFloat64ToFloat64() (map[float64]float64, error)
func (*BaseItfImpl) ToMapInt ¶
func (b *BaseItfImpl) ToMapInt() (map[int]interface{}, error)
func (*BaseItfImpl) ToMapInt32 ¶
func (b *BaseItfImpl) ToMapInt32() (map[int32]interface{}, error)
func (*BaseItfImpl) ToMapInt64 ¶
func (b *BaseItfImpl) ToMapInt64() (map[int64]interface{}, error)
func (*BaseItfImpl) ToMapInt64ToInt64 ¶
func (b *BaseItfImpl) ToMapInt64ToInt64() (map[int64]int64, error)
func (*BaseItfImpl) ToMapIntToInt ¶
func (b *BaseItfImpl) ToMapIntToInt() (map[int]int, error)
func (*BaseItfImpl) ToMapItf ¶
func (b *BaseItfImpl) ToMapItf() (map[interface{}]interface{}, error)
func (*BaseItfImpl) ToMapStrToStr ¶
func (b *BaseItfImpl) ToMapStrToStr() (map[string]string, error)
func (*BaseItfImpl) ToMapUint ¶
func (b *BaseItfImpl) ToMapUint() (map[uint]interface{}, error)
func (*BaseItfImpl) ToMapUint32 ¶
func (b *BaseItfImpl) ToMapUint32() (map[uint32]interface{}, error)
func (*BaseItfImpl) ToMapUint64 ¶
func (b *BaseItfImpl) ToMapUint64() (map[uint64]interface{}, error)
func (*BaseItfImpl) ToRune ¶ added in v1.2.1
func (b *BaseItfImpl) ToRune() (rune, error)
func (*BaseItfImpl) ToStr ¶
func (b *BaseItfImpl) ToStr() (string, error)
func (*BaseItfImpl) ToStruct ¶ added in v1.2.1
func (b *BaseItfImpl) ToStruct(stc interface{}) (interface{}, error)
ToObjectType ----------------------------------------------------------------------------------------
func (*BaseItfImpl) ToUint ¶
func (b *BaseItfImpl) ToUint() (uint, error)
func (*BaseItfImpl) ToUint32 ¶
func (b *BaseItfImpl) ToUint32() (uint32, error)
func (*BaseItfImpl) ToUint64 ¶
func (b *BaseItfImpl) ToUint64() (uint64, error)
func (*BaseItfImpl) Uniq ¶ added in v1.2.1
func (b *BaseItfImpl) Uniq() api.MapInterface
func (*BaseItfImpl) Val ¶
func (b *BaseItfImpl) Val() (interface{}, error)
func (*BaseItfImpl) Valid ¶
func (b *BaseItfImpl) Valid() bool
type BasicItf ¶
type BasicItf interface {
api.MapInterface
WithIterChain(iterChain *IterChain) BasicItf
}
func NewBasicItfImpl ¶
NewBasicItfImpl 非map,list类型的结构,通常用于对对象做类型转换;
type BasicItfImpl ¶
type BasicItfImpl struct {
BaseItfImpl
OriginItf interface{}
}
func (*BasicItfImpl) Get ¶
func (m *BasicItfImpl) Get(key interface{}) api.MapInterface
func (*BasicItfImpl) GetAny ¶
func (m *BasicItfImpl) GetAny(keys ...interface{}) api.MapInterface
func (*BasicItfImpl) Index ¶
func (m *BasicItfImpl) Index(index int) api.MapInterface
func (*BasicItfImpl) New ¶ added in v1.2.1
func (m *BasicItfImpl) New() api.MapInterface
func (*BasicItfImpl) OrgVal ¶ added in v1.2.1
func (m *BasicItfImpl) OrgVal() (interface{}, error)
func (*BasicItfImpl) WithIterChain ¶ added in v1.2.1
func (m *BasicItfImpl) WithIterChain(iterChain *IterChain) BasicItf
type BasicListItf ¶
type BasicListItf interface {
api.MapInterface
WithIterChain(iterChain *IterChain) BasicListItf
}
func NewBasicListItfImpl ¶
func NewBasicListItfImpl(ctx context.Context, m interface{}) BasicListItf
NewBasicListItfImpl 表示一个基础的list类型,val是基础类型,如:[]int.
type BasicListItfImpl ¶
type BasicListItfImpl struct {
BaseItfImpl
OriginVal interface{}
}
func (*BasicListItfImpl) Exist ¶ added in v1.2.1
func (m *BasicListItfImpl) Exist(key interface{}) (interface{}, bool)
func (*BasicListItfImpl) Get ¶
func (m *BasicListItfImpl) Get(key interface{}) api.MapInterface
func (*BasicListItfImpl) GetAny ¶
func (m *BasicListItfImpl) GetAny(keys ...interface{}) api.MapInterface
func (*BasicListItfImpl) Index ¶
func (m *BasicListItfImpl) Index(index int) api.MapInterface
func (*BasicListItfImpl) New ¶ added in v1.2.1
func (m *BasicListItfImpl) New() api.MapInterface
func (*BasicListItfImpl) OrgVal ¶ added in v1.2.1
func (m *BasicListItfImpl) OrgVal() (interface{}, error)
func (*BasicListItfImpl) SetAllAsMap ¶ added in v1.2.2
func (m *BasicListItfImpl) SetAllAsMap() (orgVal interface{}, err error)
func (*BasicListItfImpl) SetAsMap ¶ added in v1.2.1
func (m *BasicListItfImpl) SetAsMap(key interface{}) (orgVal interface{}, err error)
func (*BasicListItfImpl) SetMap ¶ added in v1.2.1
func (m *BasicListItfImpl) SetMap(key interface{}, val interface{}) (orgVal interface{}, err error)
func (*BasicListItfImpl) WithIterChain ¶ added in v1.2.1
func (m *BasicListItfImpl) WithIterChain(iterChain *IterChain) BasicListItf
type EntranceFuncDefine ¶ added in v1.2.1
type EntranceFuncDefine interface {
// From 等价于Fr,入口方法
From(itf interface{}) api.MapInterface
// Fr 等价于From,携带Context的版本
Fr(ctx context.Context, itf interface{}) api.MapInterface
}
type ExceptItf ¶
type ExceptItf interface {
api.MapInterface
}
func NewExceptItfImpl ¶
func NewExceptItfImpl() ExceptItf
func NewExceptItfImplErr ¶
type ExceptItfImpl ¶
type ExceptItfImpl struct {
BaseItfImpl
}
MapStrItfImpl 典型实现,整个通过接口交互,对外封闭,对内开放
func (*ExceptItfImpl) Get ¶
func (e *ExceptItfImpl) Get(key interface{}) api.MapInterface
type ForeachItf ¶
type ForeachItf interface {
api.MapInterface
WithIterChain(iterChain *IterChain) ForeachItf
}
func NewForeachItfImpl ¶
func NewForeachItfImpl(ctx context.Context, listItf []interface{}, mapItf map[interface{}]interface{}) ForeachItf
NewForeachItfImpl 提供对map,list进行for循环的支持,返回的对象可以根据返回值定义为list或map.
type ForeachItfImpl ¶
type ForeachItfImpl struct {
BaseItfImpl
DataType DataType
ListItf []interface{}
MapItf map[interface{}]interface{}
}
func (*ForeachItfImpl) ForEach ¶ added in v1.2.1
func (m *ForeachItfImpl) ForEach(forFunc api.ForFunc) api.MapInterface
func (*ForeachItfImpl) Get ¶
func (m *ForeachItfImpl) Get(key interface{}) api.MapInterface
func (*ForeachItfImpl) GetAny ¶
func (m *ForeachItfImpl) GetAny(keys ...interface{}) api.MapInterface
func (*ForeachItfImpl) Index ¶
func (m *ForeachItfImpl) Index(index int) api.MapInterface
func (*ForeachItfImpl) IsDigit ¶ added in v1.2.1
func (m *ForeachItfImpl) IsDigit() (bool, error)
func (*ForeachItfImpl) IsDigitList ¶ added in v1.2.1
func (m *ForeachItfImpl) IsDigitList() (bool, error)
func (*ForeachItfImpl) IsList ¶ added in v1.2.1
func (m *ForeachItfImpl) IsList() (bool, error)
func (*ForeachItfImpl) IsMap ¶ added in v1.2.1
func (m *ForeachItfImpl) IsMap() (bool, error)
func (*ForeachItfImpl) IsMapStrItf ¶ added in v1.2.1
func (m *ForeachItfImpl) IsMapStrItf() (bool, error)
func (*ForeachItfImpl) IsStr ¶ added in v1.2.1
func (m *ForeachItfImpl) IsStr() (bool, error)
func (*ForeachItfImpl) IsStrList ¶ added in v1.2.1
func (m *ForeachItfImpl) IsStrList() (bool, error)
func (*ForeachItfImpl) New ¶ added in v1.2.1
func (m *ForeachItfImpl) New() api.MapInterface
func (*ForeachItfImpl) PrintPath ¶ added in v1.2.1
func (m *ForeachItfImpl) PrintPath() string
func (*ForeachItfImpl) SetAllAsMap ¶ added in v1.2.2
func (m *ForeachItfImpl) SetAllAsMap() (orgVal interface{}, err error)
func (*ForeachItfImpl) SetAsMap ¶ added in v1.2.1
func (m *ForeachItfImpl) SetAsMap(key interface{}) (orgVal interface{}, err error)
func (*ForeachItfImpl) SetMap ¶ added in v1.2.1
func (m *ForeachItfImpl) SetMap(key interface{}, val interface{}) (orgVal interface{}, err error)
func (*ForeachItfImpl) ToList ¶
func (m *ForeachItfImpl) ToList() ([]interface{}, error)
func (*ForeachItfImpl) ToListBool ¶
func (m *ForeachItfImpl) ToListBool() ([]bool, error)
func (*ForeachItfImpl) ToListFloat32 ¶
func (m *ForeachItfImpl) ToListFloat32() ([]float32, error)
func (*ForeachItfImpl) ToListFloat64 ¶
func (m *ForeachItfImpl) ToListFloat64() ([]float64, error)
func (*ForeachItfImpl) ToListInt ¶
func (m *ForeachItfImpl) ToListInt() ([]int, error)
func (*ForeachItfImpl) ToListInt32 ¶
func (m *ForeachItfImpl) ToListInt32() ([]int32, error)
func (*ForeachItfImpl) ToListInt64 ¶
func (m *ForeachItfImpl) ToListInt64() ([]int64, error)
func (*ForeachItfImpl) ToListMap ¶ added in v1.2.1
func (m *ForeachItfImpl) ToListMap() ([]map[string]interface{}, error)
func (*ForeachItfImpl) ToListRune ¶ added in v1.2.1
func (m *ForeachItfImpl) ToListRune() ([]int32, error)
func (*ForeachItfImpl) ToListStr ¶
func (m *ForeachItfImpl) ToListStr() ([]string, error)
func (*ForeachItfImpl) ToListStrF ¶
func (m *ForeachItfImpl) ToListStrF() ([]string, error)
func (*ForeachItfImpl) ToListUint ¶
func (m *ForeachItfImpl) ToListUint() ([]uint, error)
func (*ForeachItfImpl) ToListUint32 ¶
func (m *ForeachItfImpl) ToListUint32() ([]uint32, error)
func (*ForeachItfImpl) ToListUint64 ¶
func (m *ForeachItfImpl) ToListUint64() ([]uint64, error)
func (*ForeachItfImpl) ToMap ¶
func (m *ForeachItfImpl) ToMap() (map[string]interface{}, error)
func (*ForeachItfImpl) ToMapFloat32 ¶
func (m *ForeachItfImpl) ToMapFloat32() (map[float32]interface{}, error)
func (*ForeachItfImpl) ToMapFloat32ToFloat32 ¶
func (m *ForeachItfImpl) ToMapFloat32ToFloat32() (map[float32]float32, error)
func (*ForeachItfImpl) ToMapFloat64 ¶
func (m *ForeachItfImpl) ToMapFloat64() (map[float64]interface{}, error)
func (*ForeachItfImpl) ToMapFloat64ToFloat64 ¶
func (m *ForeachItfImpl) ToMapFloat64ToFloat64() (map[float64]float64, error)
func (*ForeachItfImpl) ToMapInt ¶
func (m *ForeachItfImpl) ToMapInt() (map[int]interface{}, error)
func (*ForeachItfImpl) ToMapInt32 ¶
func (m *ForeachItfImpl) ToMapInt32() (map[int32]interface{}, error)
func (*ForeachItfImpl) ToMapInt64 ¶
func (m *ForeachItfImpl) ToMapInt64() (map[int64]interface{}, error)
func (*ForeachItfImpl) ToMapInt64ToInt64 ¶
func (m *ForeachItfImpl) ToMapInt64ToInt64() (map[int64]int64, error)
func (*ForeachItfImpl) ToMapIntToInt ¶
func (m *ForeachItfImpl) ToMapIntToInt() (map[int]int, error)
func (*ForeachItfImpl) ToMapItf ¶
func (m *ForeachItfImpl) ToMapItf() (map[interface{}]interface{}, error)
func (*ForeachItfImpl) ToMapStrToStr ¶
func (m *ForeachItfImpl) ToMapStrToStr() (map[string]string, error)
func (*ForeachItfImpl) ToMapUint ¶
func (m *ForeachItfImpl) ToMapUint() (map[uint]interface{}, error)
func (*ForeachItfImpl) ToMapUint32 ¶
func (m *ForeachItfImpl) ToMapUint32() (map[uint32]interface{}, error)
func (*ForeachItfImpl) ToMapUint64 ¶
func (m *ForeachItfImpl) ToMapUint64() (map[uint64]interface{}, error)
func (*ForeachItfImpl) ToStruct ¶ added in v1.2.1
func (m *ForeachItfImpl) ToStruct(out interface{}) (interface{}, error)
func (*ForeachItfImpl) Uniq ¶ added in v1.2.1
func (m *ForeachItfImpl) Uniq() api.MapInterface
func (*ForeachItfImpl) WithIterChain ¶ added in v1.2.1
func (m *ForeachItfImpl) WithIterChain(iterChain *IterChain) ForeachItf
type IterChain ¶ added in v1.2.1
IterChain 记录迭代路径
func NewLinkedList ¶ added in v1.2.1
func NewLinkedList(val interface{}) *IterChain
func (*IterChain) PushBackByIdx ¶ added in v1.2.1
func (*IterChain) PushBackByKey ¶ added in v1.2.1
func (i *IterChain) PushBackByKey(key, val interface{})
func (*IterChain) ReplaceBack ¶ added in v1.2.1
func (i *IterChain) ReplaceBack(val interface{})
func (*IterChain) SetBackPreVal ¶ added in v1.2.1
SetBackPreVal 当当前Iter值为json-map时,把json-map序列化为map[string]interface{}并赋给上一层的map上
type IterCtx ¶ added in v1.2.1
type IterCtx struct {
Idx int // 当是list取值时,对应的是索引
Key interface{} // 取到当前值的Key
Val interface{} // 当前的值
}
func NewEnterIterCtx ¶ added in v1.2.1
func NewEnterIterCtx(val interface{}) *IterCtx
func NewIterCtx ¶ added in v1.2.1
type MapAnyToItf ¶ added in v1.2.1
type MapAnyToItf interface {
api.MapInterface
WithErr(err itferr.MapItfErr) MapAnyToItf
WithIterChain(iterChain *IterChain) MapAnyToItf
}
func NewMapAnyToItfImpl ¶ added in v1.2.1
func NewMapAnyToItfImpl(ctx context.Context, m interface{}) MapAnyToItf
NewMapAnyToItfImpl 支持任意map的取数操作
type MapAnyToItfImpl ¶ added in v1.2.1
type MapAnyToItfImpl struct {
BaseItfImpl
OriginVal interface{}
}
func (*MapAnyToItfImpl) Get ¶ added in v1.2.1
func (m *MapAnyToItfImpl) Get(key interface{}) api.MapInterface
func (*MapAnyToItfImpl) GetAny ¶ added in v1.2.1
func (m *MapAnyToItfImpl) GetAny(keys ...interface{}) api.MapInterface
func (*MapAnyToItfImpl) New ¶ added in v1.2.1
func (m *MapAnyToItfImpl) New() api.MapInterface
func (*MapAnyToItfImpl) OrgVal ¶ added in v1.2.1
func (m *MapAnyToItfImpl) OrgVal() (interface{}, error)
func (*MapAnyToItfImpl) WithErr ¶ added in v1.2.1
func (m *MapAnyToItfImpl) WithErr(err itferr.MapItfErr) MapAnyToItf
func (*MapAnyToItfImpl) WithIterChain ¶ added in v1.2.1
func (m *MapAnyToItfImpl) WithIterChain(iterChain *IterChain) MapAnyToItf
type MapListItf ¶
type MapListItf interface {
api.MapInterface
WithIterChain(iterChain *IterChain) MapListItf
}
func NewMapListItfImpl ¶
func NewMapListItfImpl(ctx context.Context, m interface{}) MapListItf
type MapListItfImpl ¶
type MapListItfImpl struct {
BaseItfImpl
OriginVal interface{}
}
func (*MapListItfImpl) Index ¶
func (m *MapListItfImpl) Index(index int) api.MapInterface
func (*MapListItfImpl) New ¶ added in v1.2.1
func (m *MapListItfImpl) New() api.MapInterface
func (*MapListItfImpl) OrgVal ¶ added in v1.2.1
func (m *MapListItfImpl) OrgVal() (interface{}, error)
func (*MapListItfImpl) WithIterChain ¶ added in v1.2.1
func (m *MapListItfImpl) WithIterChain(iterChain *IterChain) MapListItf
type MapStrItf ¶
type MapStrItf interface {
api.MapInterface
GetByPath(keys ...string) MapStrItf
WithErr(err itferr.MapItfErr) MapStrItf
WithIterChain(iterChain *IterChain) MapStrItf
}
func NewMapStrItfImpl ¶
type MapStrItfImpl ¶
type MapStrItfImpl struct {
BaseItfImpl
OriginVal map[string]interface{}
}
MapStrItfImpl 典型实现,整个通过接口交互,对外封闭,对内开放
func (*MapStrItfImpl) Get ¶
func (m *MapStrItfImpl) Get(key interface{}) api.MapInterface
func (*MapStrItfImpl) GetAny ¶
func (m *MapStrItfImpl) GetAny(keys ...interface{}) api.MapInterface
func (*MapStrItfImpl) GetByPath ¶
func (m *MapStrItfImpl) GetByPath(keys ...string) (msi MapStrItf)
Get 类似于py中json_obj[key1][key2][[key3] 或 json_obj.get(key1, {}).get(key2, [])
func (*MapStrItfImpl) GetOne ¶ added in v1.2.1
func (m *MapStrItfImpl) GetOne(key string) api.MapInterface
func (*MapStrItfImpl) New ¶ added in v1.2.1
func (m *MapStrItfImpl) New() api.MapInterface
func (*MapStrItfImpl) OrgVal ¶ added in v1.2.1
func (m *MapStrItfImpl) OrgVal() (interface{}, error)
func (*MapStrItfImpl) WithIterChain ¶ added in v1.2.1
func (m *MapStrItfImpl) WithIterChain(iterChain *IterChain) MapStrItf