Documentation
¶
Index ¶
- func AsBool(pointer unsafe.Pointer) bool
- func AsBoolAddrPtr(pointer unsafe.Pointer) **bool
- func AsBoolPtr(pointer unsafe.Pointer) *bool
- func AsBools(pointer unsafe.Pointer) []bool
- func AsBytesAddrPtr(pointer unsafe.Pointer) **[]byte
- func AsBytesPtr(pointer unsafe.Pointer) *[]byte
- func AsError(pointer unsafe.Pointer) error
- func AsErrorAddrPtr(pointer unsafe.Pointer) **error
- func AsErrorPtr(pointer unsafe.Pointer) *error
- func AsFloat32(pointer unsafe.Pointer) float32
- func AsFloat32AddrPtr(pointer unsafe.Pointer) **float32
- func AsFloat32Ptr(pointer unsafe.Pointer) *float32
- func AsFloat32s(pointer unsafe.Pointer) []float32
- func AsFloat32sPtr(pointer unsafe.Pointer) *[]float32
- func AsFloat64(pointer unsafe.Pointer) float64
- func AsFloat64AddrPtr(pointer unsafe.Pointer) **float64
- func AsFloat64Ptr(pointer unsafe.Pointer) *float64
- func AsFloat64s(pointer unsafe.Pointer) []float64
- func AsFloat64sPtr(pointer unsafe.Pointer) *[]float64
- func AsInt(pointer unsafe.Pointer) int
- func AsInt8(pointer unsafe.Pointer) int8
- func AsInt8AddrPtr(pointer unsafe.Pointer) **int8
- func AsInt8Ptr(pointer unsafe.Pointer) *int8
- func AsInt8s(pointer unsafe.Pointer) []int8
- func AsInt16(pointer unsafe.Pointer) int16
- func AsInt16AddrPtr(pointer unsafe.Pointer) **int16
- func AsInt16Ptr(pointer unsafe.Pointer) *int16
- func AsInt16s(pointer unsafe.Pointer) []int16
- func AsInt32(pointer unsafe.Pointer) int32
- func AsInt32AddrPtr(pointer unsafe.Pointer) **int32
- func AsInt32Ptr(pointer unsafe.Pointer) *int32
- func AsInt32s(pointer unsafe.Pointer) []int32
- func AsInt64(pointer unsafe.Pointer) int64
- func AsInt64AddrPtr(pointer unsafe.Pointer) **int64
- func AsInt64Ptr(pointer unsafe.Pointer) *int64
- func AsInt64s(pointer unsafe.Pointer) []int64
- func AsIntAddrPtr(pointer unsafe.Pointer) **int
- func AsIntPtr(pointer unsafe.Pointer) *int
- func AsInterface(pointer unsafe.Pointer) interface{}
- func AsInterfaces(pointer unsafe.Pointer) []interface{}
- func AsInts(pointer unsafe.Pointer) []int
- func AsIntsPtr(pointer unsafe.Pointer) *[]int
- func AsMap(pointer unsafe.Pointer) map[interface{}]interface{}
- func AsPointer(v interface{}) unsafe.Pointer
- func AsString(pointer unsafe.Pointer) string
- func AsStringAddrPtr(pointer unsafe.Pointer) **string
- func AsStringMap(pointer unsafe.Pointer) map[string]interface{}
- func AsStringPtr(pointer unsafe.Pointer) *string
- func AsStrings(pointer unsafe.Pointer) []string
- func AsStringsPtr(pointer unsafe.Pointer) *[]string
- func AsTime(pointer unsafe.Pointer) time.Time
- func AsTimeAddrPtr(pointer unsafe.Pointer) **time.Time
- func AsTimePtr(pointer unsafe.Pointer) *time.Time
- func AsUint(pointer unsafe.Pointer) uint
- func AsUint8(pointer unsafe.Pointer) uint8
- func AsUint8AddrPtr(pointer unsafe.Pointer) **uint8
- func AsUint8Ptr(pointer unsafe.Pointer) *uint8
- func AsUint8Ptrs(pointer unsafe.Pointer) *[]uint8
- func AsUint8s(pointer unsafe.Pointer) []uint8
- func AsUint16(pointer unsafe.Pointer) uint16
- func AsUint16AddrPtr(pointer unsafe.Pointer) **uint16
- func AsUint16Ptr(pointer unsafe.Pointer) *uint16
- func AsUint16s(pointer unsafe.Pointer) []uint16
- func AsUint32(pointer unsafe.Pointer) uint32
- func AsUint32AddrPtr(pointer unsafe.Pointer) **uint32
- func AsUint32Ptr(pointer unsafe.Pointer) *uint32
- func AsUint32s(pointer unsafe.Pointer) []uint32
- func AsUint64(pointer unsafe.Pointer) uint64
- func AsUint64AddrPtr(pointer unsafe.Pointer) **uint64
- func AsUint64Ptr(pointer unsafe.Pointer) *uint64
- func AsUint64s(pointer unsafe.Pointer) []uint64
- func AsUintAddrPtr(pointer unsafe.Pointer) **uint
- func AsUintPtr(pointer unsafe.Pointer) *uint
- func AsUintptr(pointer unsafe.Pointer) uintptr
- func AsUints(pointer unsafe.Pointer) []uint
- func Copy(dest, src unsafe.Pointer, k int)
- func DerefPointer(pointer unsafe.Pointer) unsafe.Pointer
- func EnsureAddressPointer(addrPtr unsafe.Pointer, target reflect.Type) *unsafe.Pointer
- func EnsurePointer(src interface{}) unsafe.Pointer
- func RefPointer(pointer unsafe.Pointer) unsafe.Pointer
- func STmSewu() error
- func SafeDerefPointer(pointer unsafe.Pointer, pType reflect.Type) unsafe.Pointer
- func ValuePointer(v *reflect.Value) unsafe.Pointer
- type Appender
- type Field
- func (f *Field) Addr(structPtr unsafe.Pointer) interface{}
- func (f *Field) Bool(structPtr unsafe.Pointer) bool
- func (f *Field) BoolAddr(structPtr unsafe.Pointer) *bool
- func (f *Field) BoolPtr(structPtr unsafe.Pointer) *bool
- func (f *Field) Bytes(structPtr unsafe.Pointer) []byte
- func (f *Field) BytesPtr(structPtr unsafe.Pointer) *[]byte
- func (f *Field) EnsurePointer(structPtr unsafe.Pointer) unsafe.Pointer
- func (f *Field) Error(structPtr unsafe.Pointer) error
- func (f *Field) ErrorPtr(structPtr unsafe.Pointer) *error
- func (f *Field) Float32(structPtr unsafe.Pointer) float32
- func (f *Field) Float32Addr(structPtr unsafe.Pointer) *float32
- func (f *Field) Float32Ptr(structPtr unsafe.Pointer) *float32
- func (f *Field) Float64(structPtr unsafe.Pointer) float64
- func (f *Field) Float64Addr(structPtr unsafe.Pointer) *float64
- func (f *Field) Float64Ptr(structPtr unsafe.Pointer) *float64
- func (f *Field) Int(structPtr unsafe.Pointer) int
- func (f *Field) Int8(structPtr unsafe.Pointer) int8
- func (f *Field) Int8Addr(structPtr unsafe.Pointer) *int8
- func (f *Field) Int8Ptr(structPtr unsafe.Pointer) *int8
- func (f *Field) Int16(structPtr unsafe.Pointer) int16
- func (f *Field) Int16Addr(structPtr unsafe.Pointer) *int16
- func (f *Field) Int16Ptr(structPtr unsafe.Pointer) *int16
- func (f *Field) Int32(structPtr unsafe.Pointer) int32
- func (f *Field) Int32Addr(structPtr unsafe.Pointer) *int32
- func (f *Field) Int32Ptr(structPtr unsafe.Pointer) *int32
- func (f *Field) Int64(structPtr unsafe.Pointer) int64
- func (f *Field) Int64Addr(structPtr unsafe.Pointer) *int64
- func (f *Field) Int64Ptr(structPtr unsafe.Pointer) *int64
- func (f *Field) IntAddr(structPtr unsafe.Pointer) *int
- func (f *Field) IntPtr(structPtr unsafe.Pointer) *int
- func (f *Field) Interface(structPtr unsafe.Pointer) interface{}
- func (f *Field) IsNil(structPtr unsafe.Pointer) bool
- func (f *Field) MustBeAssignable(y interface{})
- func (f *Field) Pointer(structPtr unsafe.Pointer) unsafe.Pointer
- func (f *Field) SafePointer(structPtr unsafe.Pointer, target reflect.Type) unsafe.Pointer
- func (f *Field) Set(structPtr unsafe.Pointer, source interface{})
- func (f *Field) SetBool(structPtr unsafe.Pointer, val bool)
- func (f *Field) SetBoolAt(ptr unsafe.Pointer, source interface{})
- func (f *Field) SetBoolPtr(structPtr unsafe.Pointer, val *bool)
- func (f *Field) SetBytes(structPtr unsafe.Pointer, val []byte)
- func (f *Field) SetBytesPtr(structPtr unsafe.Pointer, val *[]byte)
- func (f *Field) SetError(structPtr unsafe.Pointer, val error)
- func (f *Field) SetFloat32(structPtr unsafe.Pointer, val float32)
- func (f *Field) SetFloat32At(ptr unsafe.Pointer, source interface{})
- func (f *Field) SetFloat32Ptr(structPtr unsafe.Pointer, val *float32)
- func (f *Field) SetFloat64(structPtr unsafe.Pointer, val float64)
- func (f *Field) SetFloat64At(ptr unsafe.Pointer, source interface{})
- func (f *Field) SetFloat64Ptr(structPtr unsafe.Pointer, val *float64)
- func (f *Field) SetFunc(structPtr unsafe.Pointer, source interface{})
- func (f *Field) SetFuncAt(ptr unsafe.Pointer, source interface{})
- func (f *Field) SetIface(structPtr unsafe.Pointer, source interface{})
- func (f *Field) SetInt(structPtr unsafe.Pointer, val int)
- func (f *Field) SetInt8(structPtr unsafe.Pointer, val int8)
- func (f *Field) SetInt8Ptr(structPtr unsafe.Pointer, val *int8)
- func (f *Field) SetInt16(structPtr unsafe.Pointer, val int16)
- func (f *Field) SetInt16Ptr(structPtr unsafe.Pointer, val *int16)
- func (f *Field) SetInt32(structPtr unsafe.Pointer, val int32)
- func (f *Field) SetInt32Ptr(structPtr unsafe.Pointer, val *int32)
- func (f *Field) SetInt64(structPtr unsafe.Pointer, val int64)
- func (f *Field) SetInt64Ptr(structPtr unsafe.Pointer, val *int64)
- func (f *Field) SetIntAt(ptr unsafe.Pointer, source interface{})
- func (f *Field) SetIntPtr(structPtr unsafe.Pointer, val *int)
- func (f *Field) SetInterface(structPtr unsafe.Pointer, val interface{})
- func (f *Field) SetInterfaceAt(ptr unsafe.Pointer, source interface{})
- func (f *Field) SetMap(structPtr unsafe.Pointer, aMap interface{})
- func (f *Field) SetMapAt(ptr unsafe.Pointer, source interface{})
- func (f *Field) SetSlice(structPtr unsafe.Pointer, source interface{})
- func (f *Field) SetSliceAt(ptr unsafe.Pointer, source interface{})
- func (f *Field) SetString(structPtr unsafe.Pointer, val string)
- func (f *Field) SetStringAt(ptr unsafe.Pointer, source interface{})
- func (f *Field) SetStringPtr(structPtr unsafe.Pointer, val *string)
- func (f *Field) SetStruct(structPtr unsafe.Pointer, source interface{})
- func (f *Field) SetStructAt(ptr unsafe.Pointer, source interface{})
- func (f *Field) SetTime(structPtr unsafe.Pointer, val time.Time)
- func (f *Field) SetTimePtr(structPtr unsafe.Pointer, val *time.Time)
- func (f *Field) SetUint(structPtr unsafe.Pointer, val uint)
- func (f *Field) SetUint8(structPtr unsafe.Pointer, val uint8)
- func (f *Field) SetUint8Ptr(structPtr unsafe.Pointer, val *uint8)
- func (f *Field) SetUint16(structPtr unsafe.Pointer, val uint16)
- func (f *Field) SetUint16Ptr(structPtr unsafe.Pointer, val *uint16)
- func (f *Field) SetUint32(structPtr unsafe.Pointer, val uint32)
- func (f *Field) SetUint32Ptr(structPtr unsafe.Pointer, val *uint32)
- func (f *Field) SetUint64(structPtr unsafe.Pointer, val uint64)
- func (f *Field) SetUint64Ptr(structPtr unsafe.Pointer, val *uint64)
- func (f *Field) SetUintPtr(structPtr unsafe.Pointer, val *uint)
- func (f *Field) SetValue(structPtr unsafe.Pointer, source interface{})
- func (f *Field) String(structPtr unsafe.Pointer) string
- func (f *Field) StringAddr(structPtr unsafe.Pointer) *string
- func (f *Field) StringPtr(structPtr unsafe.Pointer) *string
- func (f *Field) Time(structPtr unsafe.Pointer) time.Time
- func (f *Field) TimePtr(structPtr unsafe.Pointer) *time.Time
- func (f *Field) Uint(structPtr unsafe.Pointer) uint
- func (f *Field) Uint8(structPtr unsafe.Pointer) uint8
- func (f *Field) Uint8Addr(structPtr unsafe.Pointer) *uint8
- func (f *Field) Uint8Ptr(structPtr unsafe.Pointer) *uint8
- func (f *Field) Uint16(structPtr unsafe.Pointer) uint16
- func (f *Field) Uint16Addr(structPtr unsafe.Pointer) *uint16
- func (f *Field) Uint16Ptr(structPtr unsafe.Pointer) *uint16
- func (f *Field) Uint32(structPtr unsafe.Pointer) uint32
- func (f *Field) Uint32Addr(structPtr unsafe.Pointer) *uint32
- func (f *Field) Uint32Ptr(structPtr unsafe.Pointer) *uint32
- func (f *Field) Uint64(structPtr unsafe.Pointer) uint64
- func (f *Field) Uint64Addr(structPtr unsafe.Pointer) *uint64
- func (f *Field) Uint64Ptr(structPtr unsafe.Pointer) *uint64
- func (f *Field) UintAddr(structPtr unsafe.Pointer) *uint
- func (f *Field) UintPtr(structPtr unsafe.Pointer) *uint
- func (f *Field) Value(structPtr unsafe.Pointer) interface{}
- func (f *Field) ValuePointer(structPtr unsafe.Pointer) unsafe.Pointer
- type Getter
- type Matcher
- type Slice
- func (s *Slice) AddrAt(slicePtr unsafe.Pointer, index int) interface{}
- func (s *Slice) Appender(slicePointer unsafe.Pointer) *Appender
- func (s *Slice) Cap(slicePtr unsafe.Pointer) int
- func (s *Slice) Len(slicePtr unsafe.Pointer) int
- func (s *Slice) PointerAt(sliceAddr unsafe.Pointer, index uintptr) unsafe.Pointer
- func (s *Slice) Range(slicePtr unsafe.Pointer, visit func(index int, item interface{}) bool)
- func (s *Slice) SetValueAt(slicePtr unsafe.Pointer, index int, value interface{})
- func (s *Slice) ValueAt(slicePtr unsafe.Pointer, index int) interface{}
- func (s *Slice) ValuePointerAt(slicePtr unsafe.Pointer, index int) interface{}
- type Struct
- type Type
- func (t *Type) Deref(val interface{}) interface{}
- func (t *Type) Interface(ptr unsafe.Pointer) interface{}
- func (t *Type) Kind() reflect.Kind
- func (t *Type) Pointer(value interface{}) unsafe.Pointer
- func (t *Type) Ref(value interface{}) interface{}
- func (t *Type) Type() reflect.Type
- func (t *Type) Value(ptr unsafe.Pointer) (v interface{})
- type UseItemAddrOpt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AsBoolAddrPtr ¶
AsBoolAddrPtr casts pointer to **bool
func AsBytesAddrPtr ¶
AsBytesAddrPtr casts pointer to []byte pointer
func AsBytesPtr ¶
AsBytesPtr casts pointer to []byte pointer
func AsErrorAddrPtr ¶
AsErrorAddrPtr casts pointer to **error
func AsFloat32AddrPtr ¶
AsFloat32AddrPtr casts pointer to **float32
func AsFloat32Ptr ¶
AsFloat32Ptr casts pointer to *float32
func AsFloat32s ¶
AsFloat32s casts pointer to float32 slice
func AsFloat32sPtr ¶
AsFloat32sPtr casts pointer to float32 slice
func AsFloat64AddrPtr ¶
AsFloat64AddrPtr casts pointer to **float64
func AsFloat64Ptr ¶
AsFloat64Ptr casts pointer to *float64
func AsFloat64s ¶
AsFloat64s casts pointer to float64 slice
func AsFloat64sPtr ¶
AsFloat64sPtr casts pointer to float64 slice pointer
func AsInt8AddrPtr ¶
AsInt8AddrPtr casts pointer to *int8
func AsInt16AddrPtr ¶
AsInt16AddrPtr casts pointer to *int16
func AsInt32AddrPtr ¶
AsInt32AddrPtr casts pointer to **int32
func AsInt64AddrPtr ¶
AsInt64AddrPtr casts pointer to **int64
func AsIntAddrPtr ¶
AsIntAddrPtr casts pointer to **int
func AsInterface ¶
AsInterface casts pointer to interface
func AsInterfaces ¶
AsInterfaces casts pointer to interface skuce
func AsStringAddrPtr ¶
AsStringAddrPtr casts pointer to **string
func AsStringMap ¶
AsStringMap casts pointer to map[string]interface
func AsStringPtr ¶
AsStringPtr casts pointer to *string
func AsStringsPtr ¶
AsStringsPtr casts pointer to string slice pointer
func AsTimeAddrPtr ¶
AsTimeAddrPtr cast pointer to **time.Time
func AsUint8AddrPtr ¶
AsUint8AddrPtr casts pointer to **uint
func AsUint8Ptrs ¶
AsUint8Ptrs casts pointer to uint slice pointer
func AsUint16AddrPtr ¶
AsUint16AddrPtr casts pointer to **uint
func AsUint16Ptr ¶
AsUint16Ptr casts pointer to *uint
func AsUint32AddrPtr ¶
AsUint32AddrPtr casts pointer to *uint
func AsUint32Ptr ¶
AsUint32Ptr casts pointer to *uint
func AsUint64AddrPtr ¶
AsUint64AddrPtr casts pointer to *uint
func AsUint64Ptr ¶
AsUint64Ptr casts pointer to *uint
func AsUintAddrPtr ¶
AsUintAddrPtr casts pointer to **uint
func DerefPointer ¶
DerefPointer returns deref pointer (**T -> *T)
func EnsureAddressPointer ¶
EnsureAddressPointer ensure that address pointer is not nil, ptr has to be address pointer
func EnsurePointer ¶
EnsurePointer returns unsafe pointer for src value or value pointer if you guarantee src is already pointer AsPointer is much faster option
func RefPointer ¶
RefPointer returns reference to the pointer (*T -> **T)
func SafeDerefPointer ¶
SafeDerefPointer returns deref pointer (**T -> *T), pType has to be *T
Types ¶
type Appender ¶
type Appender struct {
// contains filtered or unexported fields
}
Appender represents a slice appender
func (*Appender) Add ¶
func (a *Appender) Add() interface{}
Add grows slice by 1 and returns item pointer (see UseItemAddrOpt)
type Field ¶
type Field struct {
Name string
reflect.Type
Tag reflect.StructTag
Anonymous bool
Offset uintptr
Index uint16
// contains filtered or unexported fields
}
Field represents a field
func FieldByIndex ¶
FieldByIndex creates a field for supplied struct type and field indexAddr
func FieldByName ¶
FieldByName creates a field for supplied struct type and field name
func (*Field) EnsurePointer ¶
EnsurePointer initialises field type pointer if needed, and return filed type value pointer rather field pointer. for example if field is of T type this method returns *T, in case field is of *T, this method also return *T, if you need always field pointer use Field.Pointer method
func (*Field) Float32Addr ¶
Float32Addr cast field pointer to *float32
func (*Field) Float32Ptr ¶
Float32Ptr cast field pointer to *float32
func (*Field) Float64Addr ¶
Float64Addr cast field pointer to *float64
func (*Field) Float64Ptr ¶
Float64Ptr cast field pointer to *float64
func (*Field) MustBeAssignable ¶
func (f *Field) MustBeAssignable(y interface{})
func (*Field) SafePointer ¶
SafePointer returns field pointer, if field pointer is a pointer this method initialises that pointer
func (*Field) Set ¶
Set sets only non pointer value, the reason for this limited functionality method is speed, its 20x faster than SetValue
func (*Field) SetBoolPtr ¶
SetBoolPtr sets field *bool
func (*Field) SetBytesPtr ¶
SetBytesPtr sets field *[]byte
func (*Field) SetFloat32 ¶
SetFloat32 sets field float32
func (*Field) SetFloat32At ¶
func (*Field) SetFloat32Ptr ¶
SetFloat32Ptr sets field *float32
func (*Field) SetFloat64 ¶
SetFloat64 sets field float64
func (*Field) SetFloat64At ¶
func (*Field) SetFloat64Ptr ¶
SetFloat64Ptr sets field *float64
func (*Field) SetInt8Ptr ¶
SetInt8Ptr sets field *int
func (*Field) SetInt16Ptr ¶
SetInt16Ptr sets field *int
func (*Field) SetInt32Ptr ¶
SetInt32Ptr sets field *int
func (*Field) SetInt64Ptr ¶
SetInt64Ptr sets field *int
func (*Field) SetInterface ¶
SetInterface set field interface{}, only support empty interfaces
func (*Field) SetInterfaceAt ¶
func (*Field) SetSliceAt ¶
func (*Field) SetStringAt ¶
func (*Field) SetStringPtr ¶
SetStringPtr sets field *string
func (*Field) SetStructAt ¶
func (*Field) SetTimePtr ¶
SetTimePtr sets field *time.Time
func (*Field) SetUint8Ptr ¶
SetUint8Ptr sets field *uint
func (*Field) SetUint16Ptr ¶
SetUint16Ptr sets field *uint
func (*Field) SetUint32Ptr ¶
SetUint32Ptr sets field *uint
func (*Field) SetUint64Ptr ¶
SetUint64Ptr sets field *uint
func (*Field) SetUintPtr ¶
SetUintPtr sets field *uint
func (*Field) StringAddr ¶
StringAddr field pointer to *string
func (*Field) Uint16Addr ¶
Uint16Addr cast field pointer to *uint16
func (*Field) Uint32Addr ¶
Uint32Addr cast field pointer to *uint32
func (*Field) Uint64Addr ¶
Uint64Addr cast field pointer to *uint64
type Matcher ¶
type Matcher struct {
// contains filtered or unexported fields
}
Matcher represents a field matcher
type Slice ¶
Slice represents a slice
func (*Slice) Range ¶
Range call visit callback for each slice element , to terminate visit should return false use useItemAddr would use item pointer as *T for a slice defined as []T or []*T, otherwise for slice defined as []*T, item would get **T pointer
func (*Slice) SetValueAt ¶
type Struct ¶
type Struct struct {
Fields []Field
}
Struct represents a struct
func (*Struct) MatchByType ¶
Match matches field with type
type Type ¶
type Type struct {
// contains filtered or unexported fields
}
Type represents a Type
type UseItemAddrOpt ¶
type UseItemAddrOpt bool
UseItemAddrOpt option that instructs implementation to use item address as **T for []*T or *T for []T, otherwise *T would be used