Documentation ¶
Index ¶
- Constants
- func ConstraintUnderlying(typeParamList *types.TypeParamList, underlying types.Type) types.Type
- func EachField(typ Type, tagForName string, ...)
- func FieldDisplayName(structTag reflect.StructTag, namedTagKey string, defaultName string) (string, bool, bool)
- func FullTypeName(typ Type) string
- func NewPackage(importPath string) *types.Package
- func NewTypesTypeFromReflectType(rtype reflect.Type) types.Type
- func TryNew(u Type) (reflect.Value, bool)
- func TypeByName(importPath string, name string) types.Type
- func TypeFor(id string) types.Type
- type Method
- type RMethod
- type RStructField
- type RType
- func (rtype *RType) AssignableTo(u Type) bool
- func (rtype *RType) ConvertibleTo(u Type) bool
- func (rtype *RType) Elem() Type
- func (rtype *RType) Field(i int) StructField
- func (rtype *RType) FieldByName(name string) (StructField, bool)
- func (rtype *RType) FieldByNameFunc(match func(string) bool) (StructField, bool)
- func (rtype *RType) Implements(u Type) bool
- func (rtype *RType) In(i int) Type
- func (rtype *RType) Key() Type
- func (rtype *RType) Method(i int) Method
- func (rtype *RType) MethodByName(name string) (Method, bool)
- func (rtype *RType) Out(i int) Type
- func (rtype *RType) String() string
- func (rtype *RType) Unwrap() any
- type StructField
- type TMethod
- type TStructField
- type TType
- func (ttype *TType) AssignableTo(u Type) bool
- func (ttype *TType) Comparable() bool
- func (ttype *TType) ConvertibleTo(u Type) bool
- func (ttype *TType) Elem() Type
- func (ttype *TType) Field(i int) StructField
- func (ttype *TType) FieldByName(name string) (StructField, bool)
- func (ttype *TType) FieldByNameFunc(match func(string) bool) (StructField, bool)
- func (ttype *TType) Implements(u Type) bool
- func (ttype *TType) In(i int) Type
- func (ttype *TType) IsVariadic() bool
- func (ttype *TType) Key() Type
- func (ttype *TType) Kind() reflect.Kind
- func (ttype *TType) Len() int
- func (ttype *TType) Method(i int) Method
- func (ttype *TType) MethodByName(name string) (Method, bool)
- func (ttype *TType) Name() string
- func (ttype *TType) NumField() int
- func (ttype *TType) NumIn() int
- func (ttype *TType) NumMethod() int
- func (ttype *TType) NumOut() int
- func (ttype *TType) Out(i int) Type
- func (ttype *TType) PkgPath() string
- func (ttype *TType) String() string
- func (ttype *TType) Unwrap() any
- type Type
Constants ¶
View Source
const ( LoadFiles = packages.NeedName | packages.NeedFiles | packages.NeedCompiledGoFiles LoadImports = LoadFiles | packages.NeedImports LoadTypes = LoadImports | packages.NeedTypes | packages.NeedTypesSizes )
Variables ¶
This section is empty.
Functions ¶
func ConstraintUnderlying ¶ added in v0.1.0
func FieldDisplayName ¶
func FullTypeName ¶
func NewPackage ¶
Types ¶
type RStructField ¶
type RStructField struct {
StructField reflect.StructField
}
func (*RStructField) Anonymous ¶
func (f *RStructField) Anonymous() bool
func (*RStructField) Name ¶
func (f *RStructField) Name() string
func (*RStructField) PkgPath ¶
func (f *RStructField) PkgPath() string
func (*RStructField) Tag ¶
func (f *RStructField) Tag() reflect.StructTag
func (*RStructField) Type ¶
func (f *RStructField) Type() Type
type RType ¶
func (*RType) AssignableTo ¶
func (*RType) ConvertibleTo ¶
func (*RType) Field ¶
func (rtype *RType) Field(i int) StructField
func (*RType) FieldByName ¶
func (rtype *RType) FieldByName(name string) (StructField, bool)
func (*RType) FieldByNameFunc ¶
func (rtype *RType) FieldByNameFunc(match func(string) bool) (StructField, bool)
func (*RType) Implements ¶
type StructField ¶
type TStructField ¶
func (*TStructField) PkgPath ¶
func (f *TStructField) PkgPath() string
func (*TStructField) Tag ¶
func (f *TStructField) Tag() reflect.StructTag
func (*TStructField) Type ¶
func (f *TStructField) Type() Type
type TType ¶
func (*TType) AssignableTo ¶
func (*TType) Comparable ¶
func (*TType) ConvertibleTo ¶
func (*TType) Field ¶
func (ttype *TType) Field(i int) StructField
func (*TType) FieldByName ¶
func (ttype *TType) FieldByName(name string) (StructField, bool)
func (*TType) FieldByNameFunc ¶
func (ttype *TType) FieldByNameFunc(match func(string) bool) (StructField, bool)
func (*TType) Implements ¶
func (*TType) IsVariadic ¶ added in v0.1.0
type Type ¶
type Type interface { // Unwrap return reflect.Type or types.Type Unwrap() any Name() string PkgPath() string String() string Kind() reflect.Kind Implements(u Type) bool AssignableTo(u Type) bool ConvertibleTo(u Type) bool Comparable() bool Key() Type Elem() Type Len() int NumField() int Field(i int) StructField FieldByName(name string) (StructField, bool) FieldByNameFunc(match func(string) bool) (StructField, bool) NumMethod() int Method(i int) Method MethodByName(name string) (Method, bool) IsVariadic() bool NumIn() int In(i int) Type NumOut() int Out(i int) Type }
interface like reflect.Type but only for data type
Click to show internal directories.
Click to hide internal directories.