analysis

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Analyzer

type Analyzer interface {
	ScanFuncDecl(file *ast.File, targetAnnotation string) PackageInfo
	ScanMethodByClass(object interface{}, targetAnnotation string) PackageInfo
}

func NewAnalyzer

func NewAnalyzer() Analyzer

type FuncInfo

type FuncInfo struct {
	PkgName       string
	FuncName      string
	HasAnnotation map[string]bool
}

func (*FuncInfo) SetAnnotation

func (f *FuncInfo) SetAnnotation(annotation string)

type MethodInfo

type MethodInfo struct {
	PkgName    string
	RecvName   string
	MethodName string
	// contains filtered or unexported fields
}

func (MethodInfo) HasAnnotation

func (m MethodInfo) HasAnnotation(methodLocation string) bool

func (*MethodInfo) SetAnnotation

func (m *MethodInfo) SetAnnotation(annotation string)

type ObjectAnalyzer

type ObjectAnalyzer interface {
	AnalysisObjectToAstFiles(object interface{}) ([]*ast.File, error)
}
var (
	SingletonObjectAnalyzer ObjectAnalyzer
)

func GetSingletonObjectAnalyzerInstance

func GetSingletonObjectAnalyzerInstance() ObjectAnalyzer

type PackageInfo

type PackageInfo interface {
	GetPackageName() string
	GetRecvNames() []string
	GetRecv(recvName string) *RecvInfo
	GetFuncs() map[string]*FuncInfo
}

type RecvInfo

type RecvInfo struct {
	PkgName  string
	RecvName string
	Methods  map[string]*MethodInfo
}

func (*RecvInfo) SetMethod

func (r *RecvInfo) SetMethod(methodName string, annotations ...string)

Jump to

Keyboard shortcuts

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