parser

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2025 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StdLanguage = "go"
)

Variables

This section is empty.

Functions

func GetRawContent

func GetRawContent(fset *token.FileSet, file []byte, node ast.Node, collectComment bool) []byte

func IsTestPackage

func IsTestPackage(pkgPath string) bool

Types

type GoParser

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

golang parser, used parse multle packages from the entire project

func NewParser

func NewParser(name string, homePageDir string, o Options) *GoParser

func (*GoParser) ParseModule

func (p *GoParser) ParseModule(mod *Module, dir string) (err error)

func (*GoParser) ParseNode

func (p *GoParser) ParseNode(pkgPath string, name string) (Repository, error)

func (*GoParser) ParsePackage

func (p *GoParser) ParsePackage(pkgPath PkgPath) (Repository, error)

func (*GoParser) ParseRepo

func (p *GoParser) ParseRepo() (Repository, error)

ParseRepo parse the entiry repo from homePageDir recursively until end

type Options

type Options struct {
	ReferCodeDepth int
	Excludes       []string
	CollectComment bool
	NeedTest       bool
	LoadByPackages bool
}

type PackageCache added in v0.2.0

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

PackageCache 缓存 importPath 是否是 system package

func NewPackageCache added in v0.2.0

func NewPackageCache(lruCapacity int) *PackageCache

func (*PackageCache) IsStandardPackage added in v0.2.0

func (pc *PackageCache) IsStandardPackage(path string) bool

IsStandardPackage 检查一个包是否为标准库,并使用内部缓存。

Jump to

Keyboard shortcuts

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