Documentation
¶
Index ¶
- func BuildID(parts ...string) string
- func RepoNodeID(repoID string) string
- func ShouldSkipFile(name string) bool
- func ShouldSkipFolder(name string) bool
- func WorkspaceNodeID(workspaceID string) string
- type Edge
- type EdgeOccurrence
- type EdgeType
- type Node
- type NodeType
- type ParseResult
- type Parser
- func (p *Parser) BuildRepositoryStructure(ctx context.Context, dir string, packageFolders map[string]map[string]bool) (*ParseResult, error)
- func (p *Parser) ParsePackage(ctx context.Context, dir string) (*ParseResult, error)
- func (p *Parser) ParsePackageIncremental(ctx context.Context, dir string) (*ParseResult, error)
- func (p *Parser) ParseWorkspace(ctx context.Context, dir string) (*ParseResult, error)
- func (p *Parser) WithTests(includeTests bool) *Parser
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RepoNodeID ¶
func ShouldSkipFile ¶
func ShouldSkipFolder ¶
func WorkspaceNodeID ¶
Types ¶
type Edge ¶
type Edge struct {
From string
To string
Type EdgeType
RepoID string // The ID of the repository that discovered this edge
Occurrences []EdgeOccurrence `json:"occurrences,omitempty"`
}
Edge represents a relation between two nodes
type EdgeOccurrence ¶
type EdgeType ¶
type EdgeType string
EdgeType defines the relation between two nodes
const ( EdgeTypeCalls EdgeType = "CALLS" EdgeTypeImplements EdgeType = "IMPLEMENTS" EdgeTypeImports EdgeType = "IMPORTS" EdgeTypeReferences EdgeType = "REFERENCES" EdgeTypeInstantiates EdgeType = "INSTANTIATES" EdgeTypeSpawns EdgeType = "SPAWNS" EdgeTypeSendsTo EdgeType = "SENDS_TO" EdgeTypeReceivesFrom EdgeType = "RECEIVES_FROM" EdgeTypeContains EdgeType = "CONTAINS" // e.g. Package contains File, File contains Func EdgeTypeRegistersRoute EdgeType = "REGISTERS_ROUTE" )
type Node ¶
type NodeType ¶
type NodeType string
NodeType defines the type of a parsed node
const ( NodeTypePackage NodeType = "PACKAGE" NodeTypeFile NodeType = "FILE" NodeTypeFolder NodeType = "FOLDER" NodeTypeStruct NodeType = "STRUCT" NodeTypeInterface NodeType = "INTERFACE" NodeTypeFunc NodeType = "FUNC" NodeTypeMethod NodeType = "METHOD" NodeTypeConstant NodeType = "CONSTANT" NodeTypeVariable NodeType = "VARIABLE" NodeTypeTypeAlias NodeType = "TYPE_ALIAS" NodeTypeChannel NodeType = "CHANNEL" NodeTypeGoroutine NodeType = "GOROUTINE" NodeTypeRoute NodeType = "ROUTE" NodeTypeBoundary NodeType = "BOUNDARY" // External package/func NodeTypeRepo NodeType = "REPO" NodeTypeWorkspace NodeType = "WORKSPACE" )
type ParseResult ¶
type Parser ¶
func NewWorkspaceParser ¶
func (*Parser) BuildRepositoryStructure ¶
func (p *Parser) BuildRepositoryStructure(ctx context.Context, dir string, packageFolders map[string]map[string]bool) (*ParseResult, error)
BuildRepositoryStructure builds the physical folder tree and folder-to-package containment edges for the repository root using already-known package locations. The packageFolders map is keyed by slash-separated relative folder path, with "." representing the repository root.
func (*Parser) ParsePackage ¶
ParsePackage parses a single package directory and returns its entities. Prefer ParsePackageIncremental for watch-mode updates.
func (*Parser) ParsePackageIncremental ¶
ParsePackageIncremental parses a single package for watch-mode incremental updates. It intentionally omits NeedDeps to avoid loading hundreds of transitive dependency packages into memory on every file save, keeping the RAM footprint low. Cross-package IMPLEMENTS edges are not resolved here as they require full dependency info; those edges remain from the last full analysis run.
func (*Parser) ParseWorkspace ¶
ParseWorkspace loads and parses the Go codebase in the given directory.