Documentation ¶
Index ¶
- Variables
- func DigestType(t reflect.Type) uint64
- func FinalPointedType(pointerType reflect.Type) reflect.Type
- func FinalPointedValue(pointerValue reflect.Value) reflect.Value
- func GetAllTypesForFunction(funcType reflect.Type) (inputTypes []reflect.Type, outputTypes []reflect.Type)
- func GetValueOfField(v interface{}, tree ...string) interface{}
- func GetValueOfFieldByReflect(v reflect.Value, tree ...string) reflect.Value
- func IsReflectType(v interface{}) bool
- func NewFinalValue(startType reflect.Type) reflect.Value
- func NewFinalValueFrom(fromValue reflect.Value, finalTypeOfPointer reflect.Type) reflect.Value
- func NewPointerValue(targetValue interface{}) interface{}
- func SetValueOfField(v interface{}, newFieldValue interface{}, tree ...string)
- func SetValueOfFieldByReflect(v reflect.Value, newFieldValue reflect.Value, tree ...string)
- func TypeOfInterface(v interface{}) reflect.Type
- func TypeOfValue(v interface{}) reflect.Type
Constants ¶
This section is empty.
Variables ¶
var ( /** * Buildin types */ HashTypeOfInt = DigestType(TypeOfInt) HashTypeOfInt64 = DigestType(TypeOfInt64) HashTypeOfInt32 = DigestType(TypeOfInt32) HashTypeOfInt16 = DigestType(TypeOfInt16) HashTypeOfInt8 = DigestType(TypeOfInt8) HashTypeOfUint = DigestType(TypeOfUint) HashTypeOfUint64 = DigestType(TypeOfUint64) HashTypeOfUint32 = DigestType(TypeOfUint32) HashTypeOfUint16 = DigestType(TypeOfUint16) HashTypeOfUint8 = DigestType(TypeOfUint8) HashTypeOfFloat32 = DigestType(TypeOfFloat32) HashTypeOfFloat64 = DigestType(TypeOfFloat64) HashTypeOfComplex64 = DigestType(TypeOfComplex64) HashTypeOfComplex128 = DigestType(TypeOfComplex128) HashTypeOfByte = DigestType(TypeOfByte) HashTypeOfBool = DigestType(TypeOfBool) HashTypeOfString = DigestType(TypeOfString) /** * Slice Types */ HashPTypeOfInt = DigestType(PTypeOfInt) HashPTypeOfInt64 = DigestType(PTypeOfInt64) HashPTypeOfInt32 = DigestType(PTypeOfInt32) HashPTypeOfInt16 = DigestType(PTypeOfInt16) HashPTypeOfInt8 = DigestType(PTypeOfInt8) HashPTypeOfUint = DigestType(PTypeOfUint) HashPTypeOfUint64 = DigestType(PTypeOfUint64) HashPTypeOfUint32 = DigestType(PTypeOfUint32) HashPTypeOfUint16 = DigestType(PTypeOfUint16) HashPTypeOfUint8 = DigestType(PTypeOfUint8) HashPTypeOfFloat32 = DigestType(PTypeOfFloat32) HashPTypeOfFloat64 = DigestType(PTypeOfFloat64) HashPTypeOfComplex64 = DigestType(PTypeOfComplex64) HashPTypeOfComplex128 = DigestType(PTypeOfComplex128) HashPTypeOfByte = DigestType(PTypeOfByte) HashPTypeOfBool = DigestType(PTypeOfBool) HashPTypeOfString = DigestType(PTypeOfString) /** * Slice type */ HashSTypeOfInt = DigestType(STypeOfInt) HashSTypeOfInt64 = DigestType(STypeOfInt64) HashSTypeOfInt32 = DigestType(STypeOfInt32) HashSTypeOfInt16 = DigestType(STypeOfInt16) HashSTypeOfInt8 = DigestType(STypeOfInt8) HashSTypeOfUint = DigestType(STypeOfUint) HashSTypeOfUint64 = DigestType(STypeOfUint64) HashSTypeOfUint32 = DigestType(STypeOfUint32) HashSTypeOfUint16 = DigestType(STypeOfUint16) HashSTypeOfUint8 = DigestType(STypeOfUint8) HashSTypeOfFloat32 = DigestType(STypeOfFloat32) HashSTypeOfFloat64 = DigestType(STypeOfFloat64) HashSTypeOfComplex64 = DigestType(STypeOfComplex64) HashSTypeOfComplex128 = DigestType(STypeOfComplex128) HashSTypeOfByte = DigestType(STypeOfByte) HashSTypeOfBool = DigestType(STypeOfBool) HashSTypeOfString = DigestType(STypeOfString) )
Hash values of reflect.Type
var TypeOfReflectType = TypeOfInterface((*reflect.Type)(nil))
Functions ¶
func DigestType ¶
Used to generate digest information of a type.
The hash value of reflect.Type could be used to generate key of map on reflect.Type, which has better performance on look-up operation on map.
algorithms for generating byte array of source:
1. UTF-8 Type.PkgPath() 2. UTF-8 Type.String()
The algorithms of hashing: hash/fnv.New64()
func FinalPointedType ¶
Gets the final pointed type of a pointer type
func FinalPointedValue ¶
Gets the final value of pointer, it may be IsNil()
func GetAllTypesForFunction ¶
func GetAllTypesForFunction(funcType reflect.Type) (inputTypes []reflect.Type, outputTypes []reflect.Type)
Gets the types of a function
This function gives the slice of types for both of input and output
func GetValueOfField ¶
func GetValueOfField(v interface{}, tree ...string) interface{}
Gets value of field, supporting tree visiting whether or not the value is struct or pointer to struct.
func GetValueOfFieldByReflect ¶
Gets value of field, supported tree visiting whether or not the value is struct or pointer to struct.
func IsReflectType ¶
func IsReflectType(v interface{}) bool
Checks if the value is type of reflect.Type
func NewFinalValue ¶
new() a value by pass through multi-layer pointers
func NewFinalValueFrom ¶
func NewPointerValue ¶
func NewPointerValue(targetValue interface{}) interface{}
func SetValueOfField ¶
func SetValueOfField(v interface{}, newFieldValue interface{}, tree ...string)
Sets value of field, supporting tree visiting whether or not the value is struct or pointer to struct.
func SetValueOfFieldByReflect ¶
Sets value of field, supporting tree visiting whether or not the value is struct or pointer to struct.
func TypeOfInterface ¶
Gets the type of interface, which is short function of:
reflect.TypeOf(nilPointerToInterface).Elem()
func TypeOfValue ¶
Types ¶
This section is empty.