var ConfigSafe = Config{UseSafeImplementation: true}.Froze()
var ConfigUnsafe = Config{UseSafeImplementation: false}.Froze()
func IFaceToEFace(ptr unsafe.Pointer) interface{}
func IsNil(obj interface{}) bool
func IsNullable(kind reflect.Kind) bool
func NoEscape(p unsafe.Pointer) unsafe.Pointer
NoEscape hides a pointer from escape analysis. noescape is the identity function but escape analysis doesn't think the output depends on the input. noescape is inlined and currently compiles down to zero instructions. USE CAREFULLY!
func PtrOf(obj interface{}) unsafe.Pointer
func RTypeOf(obj interface{}) uintptr
func UnsafeCastString(str string) []byte
type API interface { TypeOf(obj interface{}) Type Type2(type1 reflect.Type) Type }
type ArrayType interface { ListType Len() int }
type Config struct { UseSafeImplementation bool }
func (cfg Config) Froze() *frozenConfig
type InterfaceType interface { NumMethod() int }
type ListType interface { Type Elem() Type SetIndex(obj interface{}, index int, elem interface{}) UnsafeSetIndex(obj unsafe.Pointer, index int, elem unsafe.Pointer) GetIndex(obj interface{}, index int) interface{} UnsafeGetIndex(obj unsafe.Pointer, index int) unsafe.Pointer }
type MapIterator interface { HasNext() bool Next() (key interface{}, elem interface{}) UnsafeNext() (key unsafe.Pointer, elem unsafe.Pointer) }
type MapType interface { Type Key() Type Elem() Type MakeMap(cap int) interface{} UnsafeMakeMap(cap int) unsafe.Pointer SetIndex(obj interface{}, key interface{}, elem interface{}) UnsafeSetIndex(obj unsafe.Pointer, key unsafe.Pointer, elem unsafe.Pointer) TryGetIndex(obj interface{}, key interface{}) (interface{}, bool) GetIndex(obj interface{}, key interface{}) interface{} UnsafeGetIndex(obj unsafe.Pointer, key unsafe.Pointer) unsafe.Pointer Iterate(obj interface{}) MapIterator UnsafeIterate(obj unsafe.Pointer) MapIterator }
type PtrType interface { Type Elem() Type }
func TypeOfPtr(obj interface{}) PtrType
type SliceType interface { ListType MakeSlice(length int, cap int) interface{} UnsafeMakeSlice(length int, cap int) unsafe.Pointer Grow(obj interface{}, newLength int) UnsafeGrow(ptr unsafe.Pointer, newLength int) Append(obj interface{}, elem interface{}) UnsafeAppend(obj unsafe.Pointer, elem unsafe.Pointer) LengthOf(obj interface{}) int UnsafeLengthOf(ptr unsafe.Pointer) int SetNil(obj interface{}) UnsafeSetNil(ptr unsafe.Pointer) Cap(obj interface{}) int UnsafeCap(ptr unsafe.Pointer) int }
type StructField interface { Offset() uintptr Name() string PkgPath() string Type() Type Tag() reflect.StructTag Index() []int Anonymous() bool Set(obj interface{}, value interface{}) UnsafeSet(obj unsafe.Pointer, value unsafe.Pointer) Get(obj interface{}) interface{} UnsafeGet(obj unsafe.Pointer) unsafe.Pointer }
type StructType interface { Type NumField() int Field(i int) StructField FieldByName(name string) StructField FieldByIndex(index []int) StructField FieldByNameFunc(match func(string) bool) StructField }
type Type interface { Kind() reflect.Kind // New return pointer to data of this type New() interface{} // UnsafeNew return the allocated space pointed by unsafe.Pointer UnsafeNew() unsafe.Pointer // PackEFace cast a unsafe pointer to object represented pointer PackEFace(ptr unsafe.Pointer) interface{} // Indirect dereference object represented pointer to this type Indirect(obj interface{}) interface{} // UnsafeIndirect dereference pointer to this type UnsafeIndirect(ptr unsafe.Pointer) interface{} // Type1 returns reflect.Type Type1() reflect.Type Implements(thatType Type) bool String() string RType() uintptr // interface{} of this type has pointer like behavior LikePtr() bool IsNullable() bool IsNil(obj interface{}) bool UnsafeIsNil(ptr unsafe.Pointer) bool Set(obj interface{}, val interface{}) UnsafeSet(ptr unsafe.Pointer, val unsafe.Pointer) AssignableTo(anotherType Type) bool }
func DefaultTypeOfKind(kind reflect.Kind) Type
DefaultTypeOfKind return the non aliased default type for the kind
func PtrTo(typ Type) Type
func Type2(type1 reflect.Type) Type
func TypeByName(typeName string) Type
TypeByName return the type by its name, just like Class.forName in java
func TypeByPackageName(pkgPath string, name string) Type
TypeByPackageName return the type by its package and name
func TypeOf(obj interface{}) Type
type UnsafeArrayType struct {
// contains filtered or unexported fields
}
func (type2 *UnsafeArrayType) GetIndex(obj interface{}, index int) interface{}
func (type2 *UnsafeArrayType) Indirect(obj interface{}) interface{}
func (type2 *UnsafeArrayType) IsNil(obj interface{}) bool
func (type2 *UnsafeArrayType) LikePtr() bool
func (type2 *UnsafeArrayType) New() interface{}
func (type2 *UnsafeArrayType) PackEFace(ptr unsafe.Pointer) interface{}
func (type2 *UnsafeArrayType) RType() uintptr
func (type2 *UnsafeArrayType) Set(obj interface{}, val interface{})
func (type2 *UnsafeArrayType) SetIndex(obj interface{}, index int, elem interface{})
func (type2 *UnsafeArrayType) UnsafeGetIndex(obj unsafe.Pointer, index int) unsafe.Pointer
func (type2 *UnsafeArrayType) UnsafeIndirect(ptr unsafe.Pointer) interface{}
func (type2 *UnsafeArrayType) UnsafeIsNil(ptr unsafe.Pointer) bool
func (type2 *UnsafeArrayType) UnsafeNew() unsafe.Pointer
func (type2 *UnsafeArrayType) UnsafeSet(ptr unsafe.Pointer, val unsafe.Pointer)
func (type2 *UnsafeArrayType) UnsafeSetIndex(obj unsafe.Pointer, index int, elem unsafe.Pointer)
type UnsafeEFaceType struct {
// contains filtered or unexported fields
}
func (type2 *UnsafeEFaceType) Indirect(obj interface{}) interface{}
func (type2 *UnsafeEFaceType) IsNil(obj interface{}) bool
func (type2 *UnsafeEFaceType) LikePtr() bool
func (type2 *UnsafeEFaceType) New() interface{}
func (type2 *UnsafeEFaceType) PackEFace(ptr unsafe.Pointer) interface{}
func (type2 *UnsafeEFaceType) RType() uintptr
func (type2 *UnsafeEFaceType) Set(obj interface{}, val interface{})
func (type2 *UnsafeEFaceType) UnsafeIndirect(ptr unsafe.Pointer) interface{}
func (type2 *UnsafeEFaceType) UnsafeIsNil(ptr unsafe.Pointer) bool
func (type2 *UnsafeEFaceType) UnsafeNew() unsafe.Pointer
func (type2 *UnsafeEFaceType) UnsafeSet(ptr unsafe.Pointer, val unsafe.Pointer)
type UnsafeIFaceType struct {
// contains filtered or unexported fields
}
func (type2 *UnsafeIFaceType) Indirect(obj interface{}) interface{}
func (type2 *UnsafeIFaceType) IsNil(obj interface{}) bool
func (type2 *UnsafeIFaceType) LikePtr() bool
func (type2 *UnsafeIFaceType) New() interface{}
func (type2 *UnsafeIFaceType) PackEFace(ptr unsafe.Pointer) interface{}
func (type2 *UnsafeIFaceType) RType() uintptr
func (type2 *UnsafeIFaceType) Set(obj interface{}, val interface{})
func (type2 *UnsafeIFaceType) UnsafeIndirect(ptr unsafe.Pointer) interface{}
func (type2 *UnsafeIFaceType) UnsafeIsNil(ptr unsafe.Pointer) bool
func (type2 *UnsafeIFaceType) UnsafeNew() unsafe.Pointer
func (type2 *UnsafeIFaceType) UnsafeSet(ptr unsafe.Pointer, val unsafe.Pointer)
type UnsafeMapIterator struct {
// contains filtered or unexported fields
}
func (iter *UnsafeMapIterator) HasNext() bool
func (iter *UnsafeMapIterator) Next() (interface{}, interface{})
func (iter *UnsafeMapIterator) UnsafeNext() (unsafe.Pointer, unsafe.Pointer)
type UnsafeMapType struct {
// contains filtered or unexported fields
}
func (type2 *UnsafeMapType) GetIndex(obj interface{}, key interface{}) interface{}
func (type2 *UnsafeMapType) Indirect(obj interface{}) interface{}
func (type2 *UnsafeMapType) IsNil(obj interface{}) bool
func (type2 *UnsafeMapType) Iterate(obj interface{}) MapIterator
func (type2 *UnsafeMapType) Key() Type
func (type2 *UnsafeMapType) LikePtr() bool
func (type2 *UnsafeMapType) MakeMap(cap int) interface{}
func (type2 *UnsafeMapType) New() interface{}
func (type2 *UnsafeMapType) PackEFace(ptr unsafe.Pointer) interface{}
func (type2 *UnsafeMapType) RType() uintptr
func (type2 *UnsafeMapType) Set(obj interface{}, val interface{})
func (type2 *UnsafeMapType) SetIndex(obj interface{}, key interface{}, elem interface{})
func (type2 *UnsafeMapType) TryGetIndex(obj interface{}, key interface{}) (interface{}, bool)
func (type2 *UnsafeMapType) UnsafeGetIndex(obj unsafe.Pointer, key unsafe.Pointer) unsafe.Pointer
func (type2 *UnsafeMapType) UnsafeIndirect(ptr unsafe.Pointer) interface{}
func (type2 *UnsafeMapType) UnsafeIsNil(ptr unsafe.Pointer) bool
func (type2 *UnsafeMapType) UnsafeIterate(obj unsafe.Pointer) MapIterator
func (type2 *UnsafeMapType) UnsafeMakeMap(cap int) unsafe.Pointer
func (type2 *UnsafeMapType) UnsafeNew() unsafe.Pointer
func (type2 *UnsafeMapType) UnsafeSet(ptr unsafe.Pointer, val unsafe.Pointer)
func (type2 *UnsafeMapType) UnsafeSetIndex(obj unsafe.Pointer, key unsafe.Pointer, elem unsafe.Pointer)
type UnsafePtrType struct {
// contains filtered or unexported fields
}
func (type2 *UnsafePtrType) Indirect(obj interface{}) interface{}
func (type2 *UnsafePtrType) IsNil(obj interface{}) bool
func (type2 *UnsafePtrType) LikePtr() bool
func (type2 *UnsafePtrType) New() interface{}
func (type2 *UnsafePtrType) PackEFace(ptr unsafe.Pointer) interface{}
func (type2 *UnsafePtrType) RType() uintptr
func (type2 *UnsafePtrType) Set(obj interface{}, val interface{})
func (type2 *UnsafePtrType) UnsafeIndirect(ptr unsafe.Pointer) interface{}
func (type2 *UnsafePtrType) UnsafeIsNil(ptr unsafe.Pointer) bool
func (type2 *UnsafePtrType) UnsafeNew() unsafe.Pointer
func (type2 *UnsafePtrType) UnsafeSet(ptr unsafe.Pointer, val unsafe.Pointer)
type UnsafeSliceType struct {
// contains filtered or unexported fields
}
func (type2 *UnsafeSliceType) Append(obj interface{}, elem interface{})
func (type2 *UnsafeSliceType) Cap(obj interface{}) int
func (type2 *UnsafeSliceType) GetIndex(obj interface{}, index int) interface{}
func (type2 *UnsafeSliceType) Grow(obj interface{}, newLength int)
func (type2 *UnsafeSliceType) Indirect(obj interface{}) interface{}
func (type2 *UnsafeSliceType) IsNil(obj interface{}) bool
func (type2 *UnsafeSliceType) LengthOf(obj interface{}) int
func (type2 *UnsafeSliceType) LikePtr() bool
func (type2 *UnsafeSliceType) MakeSlice(length int, cap int) interface{}
func (type2 *UnsafeSliceType) New() interface{}
func (type2 *UnsafeSliceType) PackEFace(ptr unsafe.Pointer) interface{}
func (type2 *UnsafeSliceType) RType() uintptr
func (type2 *UnsafeSliceType) Set(obj interface{}, val interface{})
func (type2 *UnsafeSliceType) SetIndex(obj interface{}, index int, elem interface{})
func (type2 *UnsafeSliceType) SetNil(obj interface{})
func (type2 *UnsafeSliceType) UnsafeAppend(obj unsafe.Pointer, elem unsafe.Pointer)
func (type2 *UnsafeSliceType) UnsafeCap(ptr unsafe.Pointer) int
func (type2 *UnsafeSliceType) UnsafeGetIndex(obj unsafe.Pointer, index int) unsafe.Pointer
func (type2 *UnsafeSliceType) UnsafeGrow(obj unsafe.Pointer, newLength int)
func (type2 *UnsafeSliceType) UnsafeIndirect(obj unsafe.Pointer) interface{}
func (type2 *UnsafeSliceType) UnsafeIsNil(ptr unsafe.Pointer) bool
func (type2 *UnsafeSliceType) UnsafeLengthOf(obj unsafe.Pointer) int
func (type2 *UnsafeSliceType) UnsafeMakeSlice(length int, cap int) unsafe.Pointer
func (type2 *UnsafeSliceType) UnsafeNew() unsafe.Pointer
func (type2 *UnsafeSliceType) UnsafeSet(ptr unsafe.Pointer, val unsafe.Pointer)
func (type2 *UnsafeSliceType) UnsafeSetIndex(obj unsafe.Pointer, index int, elem unsafe.Pointer)
func (type2 *UnsafeSliceType) UnsafeSetNil(ptr unsafe.Pointer)
type UnsafeStructField struct { reflect.StructField // contains filtered or unexported fields }
func (field *UnsafeStructField) Anonymous() bool
func (field *UnsafeStructField) Get(obj interface{}) interface{}
func (field *UnsafeStructField) Index() []int
func (field *UnsafeStructField) Name() string
func (field *UnsafeStructField) Offset() uintptr
func (field *UnsafeStructField) PkgPath() string
func (field *UnsafeStructField) Set(obj interface{}, value interface{})
func (field *UnsafeStructField) Tag() reflect.StructTag
func (field *UnsafeStructField) Type() Type
func (field *UnsafeStructField) UnsafeGet(obj unsafe.Pointer) unsafe.Pointer
func (field *UnsafeStructField) UnsafeSet(obj unsafe.Pointer, value unsafe.Pointer)
type UnsafeStructType struct {
// contains filtered or unexported fields
}
func (type2 *UnsafeStructType) Field(i int) StructField
func (type2 *UnsafeStructType) FieldByIndex(index []int) StructField
func (type2 *UnsafeStructType) FieldByName(name string) StructField
func (type2 *UnsafeStructType) FieldByNameFunc(match func(string) bool) StructField
func (type2 *UnsafeStructType) Indirect(obj interface{}) interface{}
func (type2 *UnsafeStructType) IsNil(obj interface{}) bool
func (type2 *UnsafeStructType) LikePtr() bool
func (type2 *UnsafeStructType) New() interface{}
func (type2 *UnsafeStructType) PackEFace(ptr unsafe.Pointer) interface{}
func (type2 *UnsafeStructType) RType() uintptr
func (type2 *UnsafeStructType) Set(obj interface{}, val interface{})
func (type2 *UnsafeStructType) UnsafeIndirect(ptr unsafe.Pointer) interface{}
func (type2 *UnsafeStructType) UnsafeIsNil(ptr unsafe.Pointer) bool
func (type2 *UnsafeStructType) UnsafeNew() unsafe.Pointer
func (type2 *UnsafeStructType) UnsafeSet(ptr unsafe.Pointer, val unsafe.Pointer)