scanner

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 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 BaseInfo

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

func (*BaseInfo) FilePaths

func (b *BaseInfo) FilePaths() []string

func (*BaseInfo) Name

func (b *BaseInfo) Name() string

type InterfaceInfo

type InterfaceInfo struct {
	*BaseInfo
	// contains filtered or unexported fields
}

func (*InterfaceInfo) ExcludeTokens

func (i *InterfaceInfo) ExcludeTokens(methods []string)

func (*InterfaceInfo) GetImplements

func (i *InterfaceInfo) GetImplements() []*StructInfo

func (*InterfaceInfo) IsIncludeInterface

func (i *InterfaceInfo) IsIncludeInterface(name string) bool

func (*InterfaceInfo) Print

func (i *InterfaceInfo) Print()

func (*InterfaceInfo) Tokens

func (i *InterfaceInfo) Tokens()

type MethodInfo

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

func (*MethodInfo) Equal

func (m *MethodInfo) Equal(t *MethodInfo) bool

func (*MethodInfo) Print

func (m *MethodInfo) Print()

type PackageParser

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

func NewPackageParser

func NewPackageParser(s *Scanner, curPack string, curDir string, astPack *ast.Package) *PackageParser

func (*PackageParser) HandleFieldListForInterface

func (p *PackageParser) HandleFieldListForInterface(fields *ast.FieldList, f func(value string, namesLen int))

func (*PackageParser) HandleFuncType

func (p *PackageParser) HandleFuncType(funcType *ast.FuncType, methodInfo *MethodInfo)

func (*PackageParser) Parse

func (p *PackageParser) Parse()

func (*PackageParser) ParseFile

func (p *PackageParser) ParseFile(fileFullPath string, astFile *ast.File)

type PostParser

type PostParser interface {
	Post(structs map[string]*StructInfo, interfaces map[string]*InterfaceInfo)
}

type PostParserFunc

type PostParserFunc func(currentName string, innerName string, structs map[string]*StructInfo, interfaces map[string]*InterfaceInfo)

type Scanner

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

func New

func New(p string, r string) *Scanner

func (*Scanner) DisableImplementRelation

func (s *Scanner) DisableImplementRelation()

func (*Scanner) FindInterfaceImplements

func (s *Scanner) FindInterfaceImplements(interfaceFullName string, newMethod string)

func (*Scanner) GetAllInterface

func (s *Scanner) GetAllInterface() []string

func (*Scanner) GetInterface

func (s *Scanner) GetInterface(name string) *InterfaceInfo

func (*Scanner) GetLineFunc

func (s *Scanner) GetLineFunc(current int) func(i int, l *progress.Line)

func (*Scanner) Print

func (s *Scanner) Print()

func (*Scanner) Start

func (s *Scanner) Start(dir string, excludeDir []string)

func (*Scanner) SubModule

func (s *Scanner) SubModule(sub *Scanner, fullInterfaceName string, method string)

type StructInfo

type StructInfo struct {
	*BaseInfo
	// contains filtered or unexported fields
}

func (*StructInfo) CanIgnoreImplement

func (s *StructInfo) CanIgnoreImplement(info *InterfaceInfo) bool

func (*StructInfo) HasImplementInterface

func (s *StructInfo) HasImplementInterface(i *InterfaceInfo) bool

func (*StructInfo) MethodReceiver

func (s *StructInfo) MethodReceiver() (receiverName string, receiverType string)

func (*StructInfo) Print

func (s *StructInfo) Print()

func (*StructInfo) Tokens

func (s *StructInfo) Tokens()

type WrapperFunc

type WrapperFunc struct {
	CurrentName, InnerName string
	PostFunc               PostParserFunc
}

func (*WrapperFunc) Post

func (w *WrapperFunc) Post(structs map[string]*StructInfo, interfaces map[string]*InterfaceInfo)

Jump to

Keyboard shortcuts

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