Documentation
¶
Overview ¶
Package reflectutil implements reflect2 utility functions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToBindingName ¶
Types ¶
type DereferenceEncoder ¶
type DereferenceEncoder struct {
Encoder Encoder
}
func (*DereferenceEncoder) Encode ¶
func (r *DereferenceEncoder) Encode(ptr unsafe.Pointer, writer interface{})
type FieldBinding ¶
type FieldBinding struct { Field reflect2.StructField Name string Encoder Encoder // contains filtered or unexported fields }
FieldBinding describe how should we encode/decode the struct field
type GetEncoder ¶
type GetEncoder func(reflect2.Type, reflect2.StructField) Encoder
type StructDescriptor ¶
type StructDescriptor struct { Type *reflect2.UnsafeStructType Fields []*FieldBinding }
StructDescriptor describe how should we encode/decode the struct
func DescribeStruct ¶
func DescribeStruct(typ *reflect2.UnsafeStructType, getEncoder GetEncoder, opt *Option) *StructDescriptor
func (*StructDescriptor) GetFieldBinding ¶
func (r *StructDescriptor) GetFieldBinding(fieldName string) *FieldBinding
GetFieldBinding get one field from the descriptor by its name. Can not use map here to keep field orders.
type StructFieldEncoder ¶
type StructFieldEncoder struct {
// contains filtered or unexported fields
}
func (*StructFieldEncoder) Encode ¶
func (r *StructFieldEncoder) Encode(ptr unsafe.Pointer, writer interface{})
func (*StructFieldEncoder) Encoder ¶
func (r *StructFieldEncoder) Encoder() Encoder
Source Files
¶
Click to show internal directories.
Click to hide internal directories.