collector

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2023 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Collector

type Collector struct {
	*context.Context
	// contains filtered or unexported fields
}

Collector methods and info collector.

func New

func New(context *context.Context) *Collector

New creates new collector.

func (*Collector) CollectMethods

func (c *Collector) CollectMethods() []*method.Method

CollectMethods collect methods.

func (*Collector) CollectPackageInfo

func (c *Collector) CollectPackageInfo() (*Info, error)

CollectPackageInfo collects package info.

func (*Collector) GetImports

func (c *Collector) GetImports() map[string]string

GetImports get imports from package.

func (*Collector) MethodExists

func (c *Collector) MethodExists(methodName string) bool

MethodExists check if method exist.

type FieldInfo

type FieldInfo struct {
	Name string
	Expr ast.Expr
}

type Info

type Info struct {
	FileName string
	Object   *ast.Object
	Package  *packages.Package
	Syntax   []*ast.File
	File     *ast.File
	Struct   *ast.StructType
}

Info collected info.

func (*Info) MarshalJSON

func (i *Info) MarshalJSON() ([]byte, error)

Jump to

Keyboard shortcuts

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