att

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FieldIs

func FieldIs[T Type](f *Field) bool

func TypeIs

func TypeIs[T Type](t Type) bool

Types

type Field

type Field struct {
	Struct     *NamedStruct
	Name       string
	Type       Type
	Tag        reflect.StructTag
	Interfaces map[Marker]bool
}

func (*Field) IsMap

func (f *Field) IsMap() bool

func (*Field) IsPointer

func (f *Field) IsPointer() bool

type Marker

type Marker struct {
	Package       string
	InterfaceName string
}

func Mark

func Mark(pkg, iface string) Marker

func (Marker) String

func (m Marker) String() string

type MarkerValue

type MarkerValue struct {
	Target string
	Field  *Field
	Tag    reflect.StructTag
}

func (MarkerValue) String

func (mv MarkerValue) String() string

type Named

type Named[Underlying Type] struct {
	*types.Named
	TypedUnderlying Type
}

type NamedStruct

type NamedStruct struct {
	File  string
	Name  string
	Named *types.Named
	*types.Struct
	Fields     []*Field
	Markers    map[Marker]MarkerValue
	Interfaces map[Marker]bool
}

func (*NamedStruct) FindField

func (n *NamedStruct) FindField(tm TypeMarker) *Field

func (*NamedStruct) Is

func (n *NamedStruct) Is(m Marker) bool

type Package

type Package struct {
	*packages.Package
	NamedStructs []*NamedStruct
	TypeMarkers  []TypeMarker
}

type Type

type Type = types.Type

type TypeMarker

type TypeMarker struct {
	Marker Marker
	Name   string
	Target string
	Type   types.Type
}

func (TypeMarker) String

func (tm TypeMarker) String() string

Jump to

Keyboard shortcuts

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