Documentation ¶
Index ¶
- Variables
- func CanSet(v reflect.Value) reflect.Value
- func DumpType(w io.Writer, typ reflect.Type)
- func Field(s reflect.Value, i int) reflect.Value
- func FieldByIndex(s reflect.Value, index []int) reflect.Value
- func FieldByIndexX(v reflect.Value, index []int) reflect.Value
- func FieldByName(s reflect.Value, name string) reflect.Value
- func FieldByNameFunc(s reflect.Value, match func(name string) bool) reflect.Value
- func FieldByNameFuncX(v reflect.Value, match func(string) bool) reflect.Value
- func FieldByNameX(v reflect.Value, name string) reflect.Value
- func FieldX(v reflect.Value, i int) reflect.Value
- func IcallStat() (capacity int, allocate int, aviable int)
- func InterfaceOf(embedded []reflect.Type, methods []reflect.Method) reflect.Type
- func MakeEmptyInterface(pkgpath string, name string) reflect.Type
- func MethodByIndex(typ reflect.Type, index int) reflect.Method
- func MethodByName(typ reflect.Type, name string) (m reflect.Method, ok bool)
- func MethodX(typ reflect.Type, i int) reflect.Method
- func NamedInterfaceOf(pkgpath string, name string, embedded []reflect.Type, methods []reflect.Method) reflect.Type
- func NamedStructOf(pkgpath string, name string, fields []reflect.StructField) reflect.Type
- func NamedTypeOf(pkgpath string, name string, from reflect.Type) reflect.Type
- func NewInterfaceType(pkgpath string, name string) reflect.Type
- func NewMethodSet(styp reflect.Type, maxmfunc, maxpfunc int) reflect.Type
- func NumMethodX(typ reflect.Type) int
- func ReplaceType(pkg string, typ reflect.Type, m map[string]reflect.Type) (rtyp reflect.Type, changed bool)
- func Reset()
- func ResetAll()
- func SetElem(typ reflect.Type, elem reflect.Type)
- func SetInterfaceType(typ reflect.Type, embedded []reflect.Type, methods []reflect.Method) error
- func SetMethodSet(styp reflect.Type, methods []Method, extractStructEmbed bool) error
- func SetTypeName(typ reflect.Type, pkgpath string, name string)
- func SetUnderlying(typ reflect.Type, styp reflect.Type)
- func SetValue(v reflect.Value, x reflect.Value)
- func StructOf(fields []reflect.StructField) reflect.Type
- func StructToMethodSet(styp reflect.Type) reflect.Type
- func TypeLinks() []reflect.Type
- func TypesByString(s string) []reflect.Type
- func UpdateField(typ reflect.Type, rmap map[reflect.Type]reflect.Type) bool
- type AllocError
- type ChanDir
- type Context
- func (ctx *Context) IcallAlloc() int
- func (ctx *Context) InterfaceOf(embedded []reflect.Type, methods []reflect.Method) reflect.Type
- func (ctx *Context) NamedStructOf(pkgpath string, name string, fields []reflect.StructField) reflect.Type
- func (ctx *Context) NewMethodSet(styp reflect.Type, maxmfunc, maxpfunc int) reflect.Type
- func (ctx *Context) Reset()
- func (ctx *Context) SetMethodSet(styp reflect.Type, methods []Method, extractStructEmbed bool) error
- func (ctx *Context) StructOf(fields []reflect.StructField) reflect.Type
- func (ctx *Context) StructToMethodSet(styp reflect.Type) reflect.Type
- type Method
- type MethodInfo
- type Value
Constants ¶
This section is empty.
Variables ¶
var ( // disable unable allocate warning DisableAllocateWarning bool )
Functions ¶
func FieldByNameFunc ¶
func FieldByNameFuncX ¶ added in v0.6.3
FieldByNameFunc returns the struct field with a name that satisfies the match function. It panics if v's Kind is not struct. It returns the zero Value if no field was found.
func FieldX ¶ added in v0.6.3
Field returns the i'th field of the struct v. It panics if v's Kind is not Struct or i is out of range.
func InterfaceOf ¶ added in v0.4.0
func MakeEmptyInterface ¶ added in v0.4.0
func MethodByName ¶ added in v0.4.0
func NamedInterfaceOf ¶ added in v0.4.0
func NamedStructOf ¶ added in v0.3.2
func NamedTypeOf ¶ added in v0.3.5
func NewInterfaceType ¶ added in v0.5.3
func NewMethodSet ¶ added in v0.5.3
NewMethodSet is pre define method set of styp maxmfunc - set methodset of T max member func maxpfunc - set methodset of *T + T max member func
func NumMethodX ¶ added in v0.6.3
func ReplaceType ¶ added in v0.5.5
func SetInterfaceType ¶ added in v0.5.3
func SetMethodSet ¶ added in v0.5.3
func TypesByString ¶ added in v0.5.14
Types ¶
type AllocError ¶ added in v1.1.1
func (*AllocError) Error ¶ added in v1.1.1
func (p *AllocError) Error() string
type Context ¶ added in v1.1.0
type Context struct {
// contains filtered or unexported fields
}
var Default *Context = NewContext()
func NewContext ¶ added in v1.1.0
func NewContext() *Context
func (*Context) IcallAlloc ¶ added in v1.1.0
func (*Context) InterfaceOf ¶ added in v1.1.0
func (*Context) NamedStructOf ¶ added in v1.1.0
func (*Context) NewMethodSet ¶ added in v1.1.0
func (*Context) SetMethodSet ¶ added in v1.1.0
type Method ¶ added in v0.5.0
type Method struct { Name string PkgPath string Pointer bool Type reflect.Type Func func([]reflect.Value) []reflect.Value }
Method struct for MethodOf - name: method name - pointer: flag receiver struct or pointer - typ: method func type without receiver - fn: func with receiver as first argument
func MakeMethod ¶ added in v0.4.0
func MakeMethod(name string, pkgpath string, pointer bool, typ reflect.Type, fn func(args []reflect.Value) (result []reflect.Value)) Method
MakeMethod make reflect.Method for MethodOf - name: method name - pointer: flag receiver struct or pointer - typ: method func type without receiver - fn: func with receiver as first argument