parser

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Apr 10, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFuncOrMethodName added in v1.0.0

func GetFuncOrMethodName(fn *ast.FuncDecl) string

GetFuncOrMethodName 获取函数或方法的名称

func GetNodeId added in v1.0.8

func GetNodeId(pkg *packages.Package, node ast.Node) string

func GetObjectID added in v1.0.0

func GetObjectID(pkg string, fileName string, obj string) string

GetObjectID 获取完整标识符路径,格式:包名/文件名:标识符 pkg应为包括go module name的完整包名,例如:github.com/bootun/veronica/parser

func LoadPackages added in v1.0.0

func LoadPackages(repo string) ([]*packages.Package, error)

func NewProject

func NewProject(root string) (*project, error)

NewProject create a new project

Types

type DependencyInfo added in v1.0.0

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

func BuildDependency added in v1.0.0

func BuildDependency(pkgs []*packages.Package) (*DependencyInfo, error)

BuildDependency 构建依赖关系图

func (*DependencyInfo) GetDependency added in v1.0.0

func (d *DependencyInfo) GetDependency(targetID string) ([]string, error)

GetDependency 获取 targetID 的依赖节点

type GoModuleInfo

type GoModuleInfo struct {
	// module xxx
	Name      string
	GoVersion string
}

Go mod 信息

func ParseGoModuleInfo

func ParseGoModuleInfo(path string) (*GoModuleInfo, error)

ParseGoModuleInfo parse go.mod and return GoModuleInfo

type Graph added in v1.0.0

type Graph map[string]map[string]struct{}

Graph 存储节点之间的依赖关系,边表示"当前节点依赖于另一个节点"

type Service added in v1.0.0

type Service struct {
	Name       string
	Entrypoint string
	Ignores    []string
	Hooks      []string
}

Directories

Path Synopsis
material

Jump to

Keyboard shortcuts

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