types

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterType

func RegisterType(t *Type)

Types

type Field

type Field struct {
	// Name is the field name.
	Name string
	// PkgPath is the package path that qualifies a lower case (unexported)
	// field name. It is empty for upper case (exported) field names.
	PkgPath   string
	Type      ReflectType       // field type
	Tag       reflect.StructTag // field tag string
	Offset    uintptr           // offset within struct, in bytes
	Index     []int             // index sequence for Type.FieldByIndex
	Anonymous bool              // is an embedded field
}

type MapType

type MapType struct {
	KeyType   reflect.Type
	ValueType *ReflectType
}

type Option

type Option func(p *Type)

func WithName

func WithName(name string) Option

func WithPackage

func WithPackage(pkg string) Option

type ReflectType

type ReflectType struct {
	Type  reflect.Type // underlying type
	IsPtr bool
	*SliceType
	*MapType
	*StructType
}

type SliceType

type SliceType struct {
	ElementType *ReflectType
}

type StructType

type StructType struct {
	Method []reflect.Method
	Field  []Field
}

type Type

type Type struct {
	Name    string
	Package string // import package alias, e.g. "mypkg"
	PkgPath string // PkgPath is the package path of the type, e.g. "github.com/repo/project/mypkg"

	CompiledType  *ReflectType
	GeneratedType *ReflectType // created by reflect.StructOf
}

func LookupType

func LookupType(name string) (*Type, bool)

func NewType

func NewType(rType reflect.Type, opts ...Option) *Type

func (*Type) ElementType

func (t *Type) ElementType() reflect.Type

func (*Type) FullName

func (t *Type) FullName() string

func (*Type) Type

func (t *Type) Type() reflect.Type

Jump to

Keyboard shortcuts

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