typex

package
v0.0.33 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GMethod added in v0.0.24

type GMethod struct {
	// contains filtered or unexported fields
}

func (*GMethod) Name added in v0.0.24

func (m *GMethod) Name() string

func (*GMethod) PkgPath added in v0.0.24

func (m *GMethod) PkgPath() string

func (*GMethod) Type added in v0.0.24

func (m *GMethod) Type() Type

type GStructField added in v0.0.24

type GStructField struct {
	// contains filtered or unexported fields
}

func (*GStructField) Anonymous added in v0.0.24

func (f *GStructField) Anonymous() bool

func (*GStructField) Name added in v0.0.24

func (f *GStructField) Name() string

func (*GStructField) PkgPath added in v0.0.24

func (f *GStructField) PkgPath() string

func (*GStructField) Tag added in v0.0.24

func (f *GStructField) Tag() reflect.StructTag

func (*GStructField) Type added in v0.0.24

func (f *GStructField) Type() Type

type GType added in v0.0.24

type GType struct {
	// contains filtered or unexported fields
}

func NewGType added in v0.0.24

func NewGType(t any) (tt *GType)

func (*GType) AssignableTo added in v0.0.24

func (t *GType) AssignableTo(u Type) bool

func (*GType) Comparable added in v0.0.24

func (t *GType) Comparable() bool

func (*GType) ConvertibleTo added in v0.0.24

func (t *GType) ConvertibleTo(u Type) bool

func (*GType) Elem added in v0.0.24

func (t *GType) Elem() Type

func (*GType) Field added in v0.0.24

func (t *GType) Field(i int) StructField

func (*GType) FieldByName added in v0.0.24

func (t *GType) FieldByName(name string) (StructField, bool)

func (*GType) FieldByNameFunc added in v0.0.24

func (t *GType) FieldByNameFunc(match func(string) bool) (StructField, bool)

func (*GType) Implements added in v0.0.24

func (t *GType) Implements(u Type) bool

func (*GType) In added in v0.0.24

func (t *GType) In(i int) Type

func (*GType) IsVariadic added in v0.0.24

func (t *GType) IsVariadic() bool

func (*GType) Key added in v0.0.24

func (t *GType) Key() Type

func (*GType) Kind added in v0.0.24

func (t *GType) Kind() reflect.Kind

func (*GType) Len added in v0.0.24

func (t *GType) Len() int

func (*GType) Method added in v0.0.24

func (t *GType) Method(i int) Method

func (*GType) MethodByName added in v0.0.24

func (t *GType) MethodByName(name string) (Method, bool)

func (*GType) Name added in v0.0.24

func (t *GType) Name() string

func (*GType) NumField added in v0.0.24

func (t *GType) NumField() int

func (*GType) NumIn added in v0.0.24

func (t *GType) NumIn() int

func (*GType) NumMethod added in v0.0.24

func (t *GType) NumMethod() int

func (*GType) NumOut added in v0.0.24

func (t *GType) NumOut() int

func (*GType) Out added in v0.0.24

func (t *GType) Out(i int) Type

func (*GType) PkgPath added in v0.0.24

func (t *GType) PkgPath() string

func (*GType) String added in v0.0.24

func (t *GType) String() string

func (*GType) Unwrap added in v0.0.24

func (t *GType) Unwrap() any

type Method

type Method interface {
	PkgPath() string
	Name() string
	Type() Type
}

type RMethod added in v0.0.24

type RMethod struct {
	// contains filtered or unexported fields
}

func (*RMethod) Name added in v0.0.24

func (m *RMethod) Name() string

func (*RMethod) PkgPath added in v0.0.24

func (m *RMethod) PkgPath() string

func (*RMethod) Type added in v0.0.24

func (m *RMethod) Type() Type

type RStructField added in v0.0.24

type RStructField struct {
	// contains filtered or unexported fields
}

func (*RStructField) Anonymous added in v0.0.24

func (f *RStructField) Anonymous() bool

func (*RStructField) Name added in v0.0.24

func (f *RStructField) Name() string

func (*RStructField) PkgPath added in v0.0.24

func (f *RStructField) PkgPath() string

func (*RStructField) Tag added in v0.0.24

func (f *RStructField) Tag() reflect.StructTag

func (*RStructField) Type added in v0.0.24

func (f *RStructField) Type() Type

type RType added in v0.0.24

type RType struct {
	// contains filtered or unexported fields
}

RType wraps reflect.Type and implements typex.Type

func NewRType added in v0.0.24

func NewRType(t any) *RType

func (*RType) AssignableTo added in v0.0.24

func (t *RType) AssignableTo(u Type) bool

func (*RType) Comparable added in v0.0.24

func (t *RType) Comparable() bool

func (*RType) ConvertibleTo added in v0.0.24

func (t *RType) ConvertibleTo(u Type) bool

func (*RType) Elem added in v0.0.24

func (t *RType) Elem() Type

func (*RType) Field added in v0.0.24

func (t *RType) Field(i int) StructField

func (*RType) FieldByName added in v0.0.24

func (t *RType) FieldByName(name string) (StructField, bool)

func (*RType) FieldByNameFunc added in v0.0.24

func (t *RType) FieldByNameFunc(match func(string) bool) (StructField, bool)

func (*RType) Implements added in v0.0.24

func (t *RType) Implements(u Type) bool

func (*RType) In added in v0.0.24

func (t *RType) In(i int) Type

func (*RType) IsVariadic added in v0.0.24

func (t *RType) IsVariadic() bool

func (*RType) Key added in v0.0.24

func (t *RType) Key() Type

func (*RType) Kind added in v0.0.24

func (t *RType) Kind() reflect.Kind

func (*RType) Len added in v0.0.24

func (t *RType) Len() int

func (*RType) Method added in v0.0.24

func (t *RType) Method(i int) Method

func (*RType) MethodByName added in v0.0.24

func (t *RType) MethodByName(name string) (Method, bool)

func (*RType) Name added in v0.0.24

func (t *RType) Name() string

func (*RType) NumField added in v0.0.24

func (t *RType) NumField() int

func (*RType) NumIn added in v0.0.24

func (t *RType) NumIn() int

func (*RType) NumMethod added in v0.0.24

func (t *RType) NumMethod() int

func (*RType) NumOut added in v0.0.24

func (t *RType) NumOut() int

func (*RType) Out added in v0.0.24

func (t *RType) Out(i int) Type

func (*RType) PkgPath added in v0.0.24

func (t *RType) PkgPath() string

func (*RType) String added in v0.0.24

func (t *RType) String() string

func (*RType) Unwrap added in v0.0.24

func (t *RType) Unwrap() any

type StructField

type StructField interface {
	PkgPath() string
	Name() string
	Type() Type
	Tag() reflect.StructTag
	Anonymous() bool
}

type Type

type Type interface {
	// Unwrap to types.Type or reflect.Type
	Unwrap() any

	PkgPath() string
	Name() string
	String() string
	Kind() reflect.Kind

	Implements(Type) bool
	AssignableTo(Type) bool
	ConvertibleTo(Type) bool
	Comparable() bool

	Key() Type
	Elem() Type
	Len() int

	NumField() int
	Field(int) StructField
	FieldByName(string) (StructField, bool)
	FieldByNameFunc(func(string) bool) (StructField, bool)

	NumMethod() int
	Method(int) Method
	MethodByName(string) (Method, bool)

	IsVariadic() bool
	NumIn() int
	In(int) Type
	NumOut() int
	Out(int) Type
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL