Documentation
¶
Index ¶
- func CreateNewInstance(t reflect.Type, isReturnVal bool) interface{}
- func DoMethod(object interface{}, name string, paramList ...interface{}) []reflect.Value
- func GetBaseEntity(entity interface{}) interface{}
- func GetFieldValue(object interface{}, name string) interface{}
- func GetMethod(object interface{}, name string) reflect.Value
- func GetTagInfo(entry interface{}) map[string]reflect.StructTag
- func GetTagInfoByName(entry interface{}, name string) reflect.StructTag
- func GetTypeName(object interface{}) string
- func HasField(object interface{}, name string, fieldPrefix ...string) bool
- func HasMethod(object interface{}, name string) bool
- func HoldByEntity(entity interface{}, data map[string]interface{}, fieldPrefix ...string) map[string]interface{}
- func HoldByEntityToArray(entity interface{}, data []string, fieldPrefix ...string) []string
- func MakArray(entity interface{}) interface{}
- func MakMap(keyEntity interface{}, valEntity interface{}) interface{}
- func RemoveByEntity(entity interface{}, data map[string]interface{}, fieldPrefix ...string) map[string]interface{}
- func RemoveByEntityToArray(entity interface{}, data []string, fieldPrefix ...string) []string
- func SetFieldInt(object interface{}, name string, val int)
- func SetFieldString(object interface{}, name string, val string)
- func SetFieldValue(object interface{}, name string, val interface{})
- func ToEntity(data []interface{}, entity interface{}) (interface{}, bool)
- func ToEntityMap(data map[string]interface{}, entity interface{}, tt reflect.Type) (interface{}, bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateNewInstance ¶
根据类型创建新的实体(指针或值) isReturnVal 是否以值返回,调用方为匿名类调用时必须返回值,true:返回'值';false:返回'指针' 注意:入参数 t不是匿名函数时不能使用 isReturnVal=true
func GetFieldValue ¶
func GetFieldValue(object interface{}, name string) interface{}
*
- 利用反射取属性值
- @param object 被修改属性的对象
- @param name 属性名
- @return
func GetTagInfoByName ¶
取结构体指定属性的tag信息
func GetTypeName ¶
func GetTypeName(object interface{}) string
*
- 利用反射取实际类型名称
- @param object 被修改属性的对象
- @return
func HoldByEntity ¶
func HoldByEntity(entity interface{}, data map[string]interface{}, fieldPrefix ...string) map[string]interface{}
*
- 按实体保留map中的数据
- object 待检查对象
- data 数据
- fieldPrefix 字段前缀(可不传)
func MakMap ¶
func MakMap(keyEntity interface{}, valEntity interface{}) interface{}
*
- 动态创建数组
- keyEntity 键结构参照
- valEntity 值结构参照
func RemoveByEntity ¶
func RemoveByEntity(entity interface{}, data map[string]interface{}, fieldPrefix ...string) map[string]interface{}
*
- 按实体剔除map中的数据
- object 待检查对象
- data 数据
- fieldPrefix 字段前缀(可不传)
func SetFieldValue ¶
func SetFieldValue(object interface{}, name string, val interface{})
*
- 利用反射设置属性值
- @param object 被修改属性的对象
- @param name 属性名
- @param val 值 不确定类型
- @return
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.