visitor

package
v0.2.8-dev Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2022 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EachFile

func EachFile(collector *marker.Collector, pkgs []*packages.Package, callback FileCallback) error

func IsErrorType

func IsErrorType(t Type) bool

func IsInterfaceType

func IsInterfaceType(t Type) bool

func IsStructType

func IsStructType(t Type) bool

Types

type Array

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

func (*Array) Elem

func (a *Array) Elem() Type

func (*Array) Len

func (a *Array) Len() int64

func (*Array) Name

func (a *Array) Name() string

func (*Array) String

func (a *Array) String() string

func (*Array) Underlying

func (a *Array) Underlying() Type

type Basic

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

func (*Basic) Kind

func (b *Basic) Kind() BasicKind

func (*Basic) Name

func (b *Basic) Name() string

func (*Basic) String

func (b *Basic) String() string

func (*Basic) Underlying

func (b *Basic) Underlying() Type

type BasicInfo

type BasicInfo int

BasicInfo is a set of flags describing properties of a basic type.

const (
	IsBoolean BasicInfo = 1 << iota
	IsInteger
	IsUnsigned
	IsFloat
	IsComplex
	IsString
	IsUntyped

	IsNumeric = IsInteger | IsFloat | IsComplex
)

Properties of basic types.

type BasicKind

type BasicKind int
const (
	Invalid BasicKind = iota

	Bool
	Int
	Int8
	Int16
	Int32
	Int64
	Uint
	Uint8
	Uint16
	Uint32
	Uint64
	Uintptr
	Float32
	Float64
	Complex64
	Complex128
	String
	UnsafePointer

	UntypedBool
	UntypedInt
	UntypedRune
	UntypedFloat
	UntypedComplex
	UntypedString
	UntypedNil

	Byte = Uint8
	Rune = Int32
)

type Chan

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

func (*Chan) Direction

func (c *Chan) Direction() ChanDirection

func (*Chan) Elem

func (c *Chan) Elem() Type

func (*Chan) Name

func (a *Chan) Name() string

func (*Chan) String

func (c *Chan) String() string

func (*Chan) Underlying

func (c *Chan) Underlying() Type

type ChanDirection

type ChanDirection int
const (
	SEND ChanDirection = 1 << iota
	RECEIVE
)

type Constant

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

func (*Constant) IsExported

func (c *Constant) IsExported() string

func (*Constant) Name

func (c *Constant) Name() string

func (*Constant) String

func (c *Constant) String() string

func (*Constant) Type

func (c *Constant) Type() Type

func (*Constant) Underlying

func (c *Constant) Underlying() Type

func (*Constant) Value

func (c *Constant) Value() any

type Constants

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

func (*Constants) At

func (c *Constants) At(index int) *Constant

func (*Constants) FindByName

func (c *Constants) FindByName(name string) (*Constant, bool)

func (*Constants) Len

func (c *Constants) Len() int

type Constraint

type Constraint struct {
}

func (*Constraint) Name

func (c *Constraint) Name() string

func (*Constraint) String

func (c *Constraint) String() string

func (*Constraint) Underlying

func (c *Constraint) Underlying() Type

type CustomType

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

func (*CustomType) AliasType

func (c *CustomType) AliasType() Type

func (*CustomType) Name

func (c *CustomType) Name() string

func (*CustomType) String

func (c *CustomType) String() string

func (*CustomType) Underlying

func (c *CustomType) Underlying() Type

type CustomTypes

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

func (*CustomTypes) At

func (c *CustomTypes) At(index int) *CustomType

func (*CustomTypes) FindByName

func (c *CustomTypes) FindByName(name string) (*CustomType, bool)

func (*CustomTypes) Len

func (c *CustomTypes) Len() int

type Field

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

func (*Field) IsEmbedded

func (f *Field) IsEmbedded() bool

func (*Field) IsExported

func (f *Field) IsExported() bool

func (*Field) Name

func (f *Field) Name() string

func (*Field) Tags

func (f *Field) Tags() string

func (*Field) Type

func (f *Field) Type() Type

type File

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

func (*File) Functions

func (f *File) Functions() *Functions

func (*File) ImportMarkers

func (f *File) ImportMarkers() []marker.ImportMarker

func (*File) Imports

func (f *File) Imports() *Imports

func (*File) Interfaces

func (f *File) Interfaces() *Interfaces

func (*File) Markers

func (f *File) Markers() marker.MarkerValues

func (*File) Name

func (f *File) Name() string

func (*File) NumImportMarkers

func (f *File) NumImportMarkers() int

func (*File) Package

func (f *File) Package() *packages.Package

func (*File) Path

func (f *File) Path() string

func (*File) Structs

func (f *File) Structs() *Structs

type FileCallback

type FileCallback func(file *File, err error) error

type Files

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

func (*Files) At

func (f *Files) At(index int) *File

func (*Files) FindByName

func (f *Files) FindByName(name string) (*File, bool)

func (*Files) Len

func (f *Files) Len() int

type Function

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

func (*Function) File

func (f *Function) File() *File

func (*Function) IsVariadic

func (f *Function) IsVariadic() bool

func (*Function) Markers

func (f *Function) Markers() marker.MarkerValues

func (*Function) Name

func (f *Function) Name() string

func (*Function) Params

func (f *Function) Params() Variables

func (*Function) Position

func (f *Function) Position() Position

func (*Function) Receiver

func (f *Function) Receiver() *Variable

func (*Function) Results

func (f *Function) Results() Variables

func (*Function) String

func (f *Function) String() string

func (*Function) TypeParams

func (f *Function) TypeParams() *TypeParams

func (*Function) Underlying

func (f *Function) Underlying() Type

type Functions

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

func (*Functions) At

func (f *Functions) At(index int) *Function

func (*Functions) FindByName

func (f *Functions) FindByName(name string) (*Function, bool)

func (*Functions) Len

func (f *Functions) Len() int

type Generic

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

func (*Generic) Name

func (g *Generic) Name() string

func (*Generic) ParamName

func (g *Generic) ParamName() string

func (*Generic) String

func (g *Generic) String() string

func (*Generic) TypeParam

func (g *Generic) TypeParam() *TypeParam

func (*Generic) Underlying

func (g *Generic) Underlying() Type

type Import

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

func (*Import) Name

func (i *Import) Name() string

func (*Import) Path

func (i *Import) Path() string

func (*Import) Position

func (i *Import) Position() Position

func (*Import) SideEffect

func (i *Import) SideEffect() bool

type ImportedType

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

func (*ImportedType) Name

func (i *ImportedType) Name() string

func (*ImportedType) Package

func (i *ImportedType) Package() *packages.Package

func (*ImportedType) String

func (i *ImportedType) String() string

func (*ImportedType) Underlying

func (i *ImportedType) Underlying() Type

type Imports

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

func (*Imports) At

func (i *Imports) At(index int) *Import

func (*Imports) FindByName

func (i *Imports) FindByName(name string) (*Import, bool)

func (*Imports) FindByPath

func (i *Imports) FindByPath(path string) (*Import, bool)

func (*Imports) Len

func (i *Imports) Len() int

type Interface

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

func (*Interface) Constraints

func (i *Interface) Constraints() []*Constraint

func (*Interface) EmbeddedTypes

func (i *Interface) EmbeddedTypes() []Type

func (*Interface) ExplicitMethods

func (i *Interface) ExplicitMethods() []*Function

func (*Interface) File

func (i *Interface) File() *File

func (*Interface) InterfaceType

func (i *Interface) InterfaceType() *types.Interface

func (*Interface) IsAnonymous

func (i *Interface) IsAnonymous() bool

func (*Interface) IsConstraint

func (i *Interface) IsConstraint() bool

func (*Interface) IsEmptyInterface

func (i *Interface) IsEmptyInterface() bool

func (*Interface) IsExported

func (i *Interface) IsExported() bool

func (*Interface) Markers

func (i *Interface) Markers() marker.MarkerValues

func (*Interface) Methods

func (i *Interface) Methods() []*Function

func (*Interface) Name

func (i *Interface) Name() string

func (*Interface) NumEmbeddedTypes

func (i *Interface) NumEmbeddedTypes() int

func (*Interface) NumExplicitMethods

func (i *Interface) NumExplicitMethods() int

func (*Interface) NumMethods

func (i *Interface) NumMethods() int

func (*Interface) Position

func (i *Interface) Position() Position

func (*Interface) String

func (i *Interface) String() string

func (*Interface) Underlying

func (i *Interface) Underlying() Type

type Interfaces

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

func (*Interfaces) At

func (i *Interfaces) At(index int) *Interface

func (*Interfaces) FindByName

func (i *Interfaces) FindByName(name string) (*Interface, bool)

func (*Interfaces) Len

func (i *Interfaces) Len() int

type Map

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

func (*Map) Elem

func (m *Map) Elem() Type

func (*Map) Key

func (m *Map) Key() Type

func (*Map) Name

func (m *Map) Name() string

func (*Map) String

func (m *Map) String() string

func (*Map) Underlying

func (m *Map) Underlying() Type

type Pointer

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

func (*Pointer) Elem

func (p *Pointer) Elem() Type

func (*Pointer) Name

func (p *Pointer) Name() string

func (*Pointer) String

func (p *Pointer) String() string

func (*Pointer) Underlying

func (p *Pointer) Underlying() Type

type Position

type Position struct {
	Line   int
	Column int
}

type Slice

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

func (*Slice) Elem

func (s *Slice) Elem() Type

func (*Slice) Name

func (s *Slice) Name() string

func (*Slice) String

func (s *Slice) String() string

func (*Slice) Underlying

func (s *Slice) Underlying() Type

type Struct

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

func (*Struct) AllFields

func (s *Struct) AllFields() []*Field

func (*Struct) AllMethods

func (s *Struct) AllMethods() []*Function

func (*Struct) EmbeddedFields

func (s *Struct) EmbeddedFields() []*Field

func (*Struct) Fields

func (s *Struct) Fields() []*Field

func (*Struct) File

func (s *Struct) File() *File

func (*Struct) Implements

func (s *Struct) Implements(i *Interface) bool

func (*Struct) IsAnonymous

func (s *Struct) IsAnonymous() bool

func (*Struct) IsExported

func (s *Struct) IsExported() bool

func (*Struct) Markers

func (s *Struct) Markers() marker.MarkerValues

func (*Struct) Methods

func (s *Struct) Methods() []*Function

func (*Struct) Name

func (s *Struct) Name() string

func (*Struct) NamedType

func (s *Struct) NamedType() *types.Named

func (*Struct) NumAllFields

func (s *Struct) NumAllFields() int

func (*Struct) NumAllMethods

func (s *Struct) NumAllMethods() int

func (*Struct) NumEmbeddedFields

func (s *Struct) NumEmbeddedFields() int

func (*Struct) NumFields

func (s *Struct) NumFields() int

func (*Struct) NumMethods

func (s *Struct) NumMethods() int

func (*Struct) Position

func (s *Struct) Position() Position

func (*Struct) String

func (s *Struct) String() string

func (*Struct) Underlying

func (s *Struct) Underlying() Type

type Structs

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

func (*Structs) At

func (s *Structs) At(index int) *Struct

func (*Structs) FindByName

func (s *Structs) FindByName(name string) (*Struct, bool)

func (*Structs) Len

func (s *Structs) Len() int

type Type

type Type interface {
	Name() string
	Underlying() Type
	String() string
}

type TypeParam

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

func (*TypeParam) Name

func (t *TypeParam) Name() string

func (*TypeParam) Type

func (t *TypeParam) Type() Type

type TypeParams

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

func (*TypeParams) At

func (t *TypeParams) At(index int) *TypeParam

func (*TypeParams) Len

func (t *TypeParams) Len() int

type Variable

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

func (*Variable) Name

func (v *Variable) Name() string

func (*Variable) String

func (v *Variable) String() string

func (*Variable) Type

func (v *Variable) Type() Type

type Variables

type Variables []*Variable

func (Variables) At

func (v Variables) At(index int) *Variable

func (Variables) Len

func (v Variables) Len() int

type Variadic

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

func (*Variadic) Elem

func (v *Variadic) Elem() Type

func (*Variadic) Name

func (v *Variadic) Name() string

func (*Variadic) String

func (v *Variadic) String() string

func (*Variadic) Underlying

func (v *Variadic) Underlying() Type

Jump to

Keyboard shortcuts

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