Documentation
¶
Index ¶
- type AnyType
- type Reflection
- func (my *Reflection) CallMethodByName(methodName string, values ...reflect.Value) []reflect.Value
- func (my *Reflection) FindFieldAndFill(target, tagTitle, tagField string, process func(val reflect.Value))
- func (my *Reflection) GetReflectionType() ReflectionType
- func (my *Reflection) GetType() reflect.Type
- func (my *Reflection) GetValue() reflect.Value
- func (my *Reflection) IsSame(value any) bool
- func (my *Reflection) IsSameDeepEqual(value any) bool
- type ReflectionType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Reflection ¶
type Reflection struct { IsPtr bool IsZero bool IsTime bool // 是否是时间 // contains filtered or unexported fields }
func NewByReflectValue ¶
func NewByReflectValue(refValue reflect.Value) *Reflection
NewByReflectValue 实例化:通过reflect.Value
func (*Reflection) CallMethodByName ¶
func (my *Reflection) CallMethodByName( methodName string, values ...reflect.Value, ) []reflect.Value
CallMethodByName 通过名称调用方法
func (*Reflection) FindFieldAndFill ¶
func (my *Reflection) FindFieldAndFill( target, tagTitle, tagField string, process func(val reflect.Value), )
FindFieldAndFill 递归查找字段并填充
func (*Reflection) GetReflectionType ¶
func (my *Reflection) GetReflectionType() ReflectionType
GetReflectionType 获取Reflection类型
func (*Reflection) GetValue ¶
func (my *Reflection) GetValue() reflect.Value
GetValue 获取reflect.Value
func (*Reflection) IsSameDeepEqual ¶
func (my *Reflection) IsSameDeepEqual(value any) bool
IsSameDeepEqual 判断两个值是否相等
type ReflectionType ¶
type ReflectionType string
const ( Int ReflectionType = "I" Int8 ReflectionType = "I8" Int16 ReflectionType = "I16" Int32 ReflectionType = "I32" Int64 ReflectionType = "I64" Uint ReflectionType = "U" Uint8 ReflectionType = "U8" Uint16 ReflectionType = "U16" Uint32 ReflectionType = "U32" Uint64 ReflectionType = "U64" String ReflectionType = "STR" Float32 ReflectionType = "F32" Float64 ReflectionType = "F64" Datetime ReflectionType = "DT" Bool ReflectionType = "B" Array ReflectionType = "A" Map ReflectionType = "M" Struct ReflectionType = "S" Nil ReflectionType = "N" PtrSliceAny ReflectionType = "*[]ANY" PtrSlicePtrStruct ReflectionType = "*[]*S" PtrSliceStruct ReflectionType = "*[]S" PtrSlicePtrMap ReflectionType = "*[]*M" PtrSliceMap ReflectionType = "*[]M" PtrStruct ReflectionType = "*S" PtrPtrStruct ReflectionType = "**S" PtrPtrMap ReflectionType = "**M" PtrMap ReflectionType = "*M" // 1 Any ReflectionType = "ANY" UnKnowType ReflectionType = "UKT" )
Click to show internal directories.
Click to hide internal directories.