Documentation ¶
Index ¶
- Variables
- func Connect(dst, src interface{}) error
- func Error(err error) reflect.Value
- func Indirect(v reflect.Value) reflect.Value
- func Interface(v reflect.Value) interface{}
- func IsEmpty(v reflect.Value) bool
- func Pointer(i interface{}) unsafe.Pointer
- func Ptr(i interface{}) uintptr
- func RegisterFieldAccessor(t reflect.Type, accessor *FieldAccessor)
- func SliceLen(i interface{}) int
- func SlicePointer(i interface{}) unsafe.Pointer
- func SlicePtr(i interface{}) uintptr
- func Value(i interface{}, t reflect.Type) reflect.Value
- type ArrayValue
- type FieldAccessor
- type FieldInfo
- type MapValue
- func (mv MapValue) Delete(key interface{})
- func (mv MapValue) DeleteValue(key reflect.Value)
- func (mv MapValue) Get(key interface{}) interface{}
- func (mv MapValue) GetValue(key reflect.Value) reflect.Value
- func (mv MapValue) Interface() interface{}
- func (mv MapValue) Set(key, value interface{})
- func (mv MapValue) SetValue(key, value reflect.Value)
- type SimpleValue
- type SliceInfo
- func (s *SliceInfo) Get(ptr uintptr, i int) interface{}
- func (s *SliceInfo) GetBool(ptr uintptr, i int) bool
- func (s *SliceInfo) GetInt(ptr uintptr, i int) int
- func (s *SliceInfo) GetInt16(ptr uintptr, i int) int16
- func (s *SliceInfo) GetInt32(ptr uintptr, i int) int32
- func (s *SliceInfo) GetInt64(ptr uintptr, i int) int64
- func (s *SliceInfo) GetInt8(ptr uintptr, i int) int8
- func (s *SliceInfo) GetString(ptr uintptr, i int) string
- func (s *SliceInfo) GetUint(ptr uintptr, i int) uint
- func (s *SliceInfo) GetUint16(ptr uintptr, i int) uint16
- func (s *SliceInfo) GetUint32(ptr uintptr, i int) uint32
- func (s *SliceInfo) GetUint64(ptr uintptr, i int) uint64
- func (s *SliceInfo) GetUint8(ptr uintptr, i int) uint8
- func (s *SliceInfo) Set(ptr uintptr, i int, v interface{})
- func (s *SliceInfo) SetBool(ptr uintptr, i int, v bool)
- func (s *SliceInfo) SetInt(ptr uintptr, i int, v int)
- func (s *SliceInfo) SetInt16(ptr uintptr, i int, v int16)
- func (s *SliceInfo) SetInt32(ptr uintptr, i int, v int32)
- func (s *SliceInfo) SetInt64(ptr uintptr, i int, v int64)
- func (s *SliceInfo) SetInt8(ptr uintptr, i int, v int8)
- func (s *SliceInfo) SetString(ptr uintptr, i int, v string)
- func (s *SliceInfo) SetUint(ptr uintptr, i int, v uint)
- func (s *SliceInfo) SetUint16(ptr uintptr, i int, v uint16)
- func (s *SliceInfo) SetUint32(ptr uintptr, i int, v uint32)
- func (s *SliceInfo) SetUint64(ptr uintptr, i int, v uint64)
- func (s *SliceInfo) SetUint8(ptr uintptr, i int, v uint8)
- type SliceValue
- func (sv SliceValue) Add(x interface{})
- func (sv SliceValue) AddValue(x ...reflect.Value)
- func (sv SliceValue) Get(i int) interface{}
- func (sv SliceValue) GetValue(i int) reflect.Value
- func (sv SliceValue) Interface() interface{}
- func (sv SliceValue) Set(i int, x interface{})
- func (sv SliceValue) SetValue(i int, x reflect.Value)
- type StructTag
- type StructValue
Constants ¶
This section is empty.
Variables ¶
View Source
var ( TypeError = reflect.TypeOf((*error)(nil)).Elem() TypeContext = reflect.TypeOf((*context.Context)(nil)).Elem() TypeString = reflect.TypeOf("") TypeBool = reflect.TypeOf(true) TypeBytes = reflect.TypeOf([]byte{}) TypeInt = reflect.TypeOf(int(0)) TypeInt8 = reflect.TypeOf(int8(0)) TypeInt16 = reflect.TypeOf(int16(0)) TypeInt32 = reflect.TypeOf(int32(0)) TypeInt64 = reflect.TypeOf(int64(0)) TypeUint = reflect.TypeOf(uint(0)) TypeUint8 = reflect.TypeOf(uint8(0)) TypeUint16 = reflect.TypeOf(uint16(0)) TypeUint32 = reflect.TypeOf(uint32(0)) TypeUint64 = reflect.TypeOf(uint64(0)) TypeFloat32 = reflect.TypeOf(float32(0)) TypeFloat64 = reflect.TypeOf(float64(0)) TypeTime = reflect.TypeOf(time.Time{}) TypeDuration = reflect.TypeOf(time.Duration(0)) )
View Source
var (
ZeroError = reflect.Zero(TypeError)
)
Functions ¶
func Connect ¶
func Connect(dst, src interface{}) error
Connect fill all func fields of dst with methods of src.
func Interface ¶
Interface convert v to it's interface value, if v is nil value, return nil directly
func RegisterFieldAccessor ¶
func RegisterFieldAccessor(t reflect.Type, accessor *FieldAccessor)
func SlicePointer ¶
Types ¶
type ArrayValue ¶
func ArrayOf ¶
func ArrayOf(v reflect.Value) ArrayValue
func (ArrayValue) Get ¶
func (av ArrayValue) Get(i int) interface{}
func (ArrayValue) Interface ¶
func (av ArrayValue) Interface() interface{}
func (ArrayValue) Set ¶
func (av ArrayValue) Set(i int, x interface{})
type FieldAccessor ¶
type FieldAccessor struct { Get func(ptr uintptr, f *reflect.StructField) interface{} Set func(ptr uintptr, f *reflect.StructField, v interface{}) GetPointer func(ptr uintptr, f *reflect.StructField) interface{} }
type FieldInfo ¶
type FieldInfo struct { *reflect.StructField // contains filtered or unexported fields }
func NewFieldInfo ¶
func NewFieldInfo(f *reflect.StructField) *FieldInfo
func (*FieldInfo) GetPointer ¶
type MapValue ¶
func (MapValue) DeleteValue ¶
type SimpleValue ¶
func SimpleOf ¶
func SimpleOf(v reflect.Value) SimpleValue
func (SimpleValue) Interface ¶
func (sv SimpleValue) Interface() interface{}
func (SimpleValue) Set ¶
func (sv SimpleValue) Set(x interface{})
func (SimpleValue) SetValue ¶
func (sv SimpleValue) SetValue(x reflect.Value)
type SliceInfo ¶
type SliceInfo struct {
// contains filtered or unexported fields
}
func NewSliceInfo ¶
type SliceValue ¶
func SliceOf ¶
func SliceOf(v reflect.Value) SliceValue
func (SliceValue) Add ¶
func (sv SliceValue) Add(x interface{})
func (SliceValue) AddValue ¶
func (sv SliceValue) AddValue(x ...reflect.Value)
func (SliceValue) Get ¶
func (sv SliceValue) Get(i int) interface{}
func (SliceValue) Interface ¶
func (sv SliceValue) Interface() interface{}
func (SliceValue) Set ¶
func (sv SliceValue) Set(i int, x interface{})
type StructValue ¶
func StructOf ¶
func StructOf(v reflect.Value) StructValue
func (StructValue) Interface ¶
func (sv StructValue) Interface() interface{}
func (StructValue) VisitFields ¶
func (sv StructValue) VisitFields(fn func(fv reflect.Value, fi *reflect.StructField) error) error
func (StructValue) VisitMethods ¶
Click to show internal directories.
Click to hide internal directories.