Versions in this module Expand all Collapse all v0 v0.4.1 Jan 26, 2026 Changes in this version + const DefaultMaxDepth + const DefaultMaxEdges + const DefaultMaxMemoryMB + const DefaultMaxNodes + const DefaultQueryLimit + const DefaultWorkerCount + const MaxQueryLimit + const MaxTraversalDepth + var ErrBuildCancelled = errors.New("build cancelled") + var ErrDuplicateNode = errors.New("duplicate node ID") + var ErrGraphFrozen = errors.New("graph is frozen and cannot be modified") + var ErrInvalidEdgeType = errors.New("invalid edge type for node kinds") + var ErrInvalidNode = errors.New("invalid node") + var ErrMaxEdgesExceeded = errors.New("maximum edge count exceeded") + var ErrMaxNodesExceeded = errors.New("maximum node count exceeded") + var ErrMemoryLimitExceeded = errors.New("memory limit exceeded") + var ErrNodeNotFound = errors.New("node not found") + type BuildProgress struct + EdgesCreated int + FilesProcessed int + FilesTotal int + NodesCreated int + Phase ProgressPhase + type BuildResult struct + EdgeErrors []EdgeError + FileErrors []FileError + Graph *Graph + Incomplete bool + Stats BuildStats + func (r *BuildResult) HasErrors() bool + func (r *BuildResult) Success() bool + func (r *BuildResult) TotalErrors() int + type BuildStats struct + AmbiguousResolves int + DurationMilli int64 + EdgesCreated int + FilesFailed int + FilesProcessed int + NodesCreated int + PlaceholderNodes int + type Builder struct + func NewBuilder(opts ...BuilderOption) *Builder + func (b *Builder) Build(ctx context.Context, results []*ast.ParseResult) (*BuildResult, error) + type BuilderOption func(*BuilderOptions) + func WithBuilderMaxEdges(n int) BuilderOption + func WithBuilderMaxNodes(n int) BuilderOption + func WithMaxMemoryMB(mb int) BuilderOption + func WithProgressCallback(fn ProgressFunc) BuilderOption + func WithProjectRoot(root string) BuilderOption + func WithWorkerCount(n int) BuilderOption + type BuilderOptions struct + MaxEdges int + MaxMemoryMB int + MaxNodes int + ProgressCallback ProgressFunc + ProjectRoot string + WorkerCount int + func DefaultBuilderOptions() BuilderOptions + type Edge struct + FromID string + Location ast.Location + ToID string + Type EdgeType + type EdgeError struct + EdgeType EdgeType + Err error + FromID string + ToID string + func (e EdgeError) Error() string + func (e EdgeError) Unwrap() error + type EdgeType int + const EdgeTypeCalls + const EdgeTypeDefines + const EdgeTypeEmbeds + const EdgeTypeImplements + const EdgeTypeImports + const EdgeTypeParameters + const EdgeTypeReceives + const EdgeTypeReferences + const EdgeTypeReturns + const EdgeTypeUnknown + func (t EdgeType) String() string + type FileError struct + Err error + FilePath string + func (e FileError) Error() string + func (e FileError) Unwrap() error + type Graph struct + BuiltAtMilli int64 + ProjectRoot string + func NewGraph(projectRoot string, opts ...GraphOption) *Graph + func (g *Graph) AddEdge(fromID, toID string, edgeType EdgeType, loc ast.Location) error + func (g *Graph) AddNode(symbol *ast.Symbol) (*Node, error) + func (g *Graph) Clone() *Graph + func (g *Graph) EdgeCount() int + func (g *Graph) Edges() []*Edge + func (g *Graph) FindCalleesByID(ctx context.Context, symbolID string, opts ...QueryOption) (*QueryResult, error) + func (g *Graph) FindCalleesByName(ctx context.Context, name string, opts ...QueryOption) (map[string]*QueryResult, error) + func (g *Graph) FindCallersByID(ctx context.Context, symbolID string, opts ...QueryOption) (*QueryResult, error) + func (g *Graph) FindCallersByName(ctx context.Context, name string, opts ...QueryOption) (map[string]*QueryResult, error) + func (g *Graph) FindImplementationsByID(ctx context.Context, interfaceID string, opts ...QueryOption) (*QueryResult, error) + func (g *Graph) FindImplementationsByName(ctx context.Context, name string, opts ...QueryOption) (map[string]*QueryResult, error) + func (g *Graph) FindImporters(ctx context.Context, packagePath string, opts ...QueryOption) ([]string, error) + func (g *Graph) FindReferencesByID(ctx context.Context, symbolID string, opts ...QueryOption) ([]ast.Location, error) + func (g *Graph) Freeze() + func (g *Graph) GetCallGraph(ctx context.Context, symbolID string, opts ...QueryOption) (*TraversalResult, error) + func (g *Graph) GetDependencyTree(ctx context.Context, filePath string, opts ...QueryOption) (*TraversalResult, error) + func (g *Graph) GetNode(id string) (*Node, bool) + func (g *Graph) GetNodesByFile(filePath string) []*Node + func (g *Graph) GetReverseCallGraph(ctx context.Context, symbolID string, opts ...QueryOption) (*TraversalResult, error) + func (g *Graph) GetTypeHierarchy(ctx context.Context, typeID string, opts ...QueryOption) (*TraversalResult, error) + func (g *Graph) IsFrozen() bool + func (g *Graph) MergeParseResult(result *ast.ParseResult) (int, error) + func (g *Graph) NodeCount() int + func (g *Graph) Nodes() func(yield func(string, *Node) bool) + func (g *Graph) RemoveFile(filePath string) (int, error) + func (g *Graph) ShortestPath(ctx context.Context, fromID, toID string) (*PathResult, error) + func (g *Graph) State() GraphState + func (g *Graph) Stats() GraphStats + func (g *Graph) Validate() error + type GraphOption func(*GraphOptions) + func WithMaxEdges(n int) GraphOption + func WithMaxNodes(n int) GraphOption + type GraphOptions struct + MaxEdges int + MaxNodes int + func DefaultGraphOptions() GraphOptions + type GraphState int + const GraphStateBuilding + const GraphStateReadOnly + func (s GraphState) String() string + type GraphStats struct + BuiltAtMilli int64 + EdgeCount int + EdgesByType map[EdgeType]int + MaxEdges int + MaxNodes int + NodeCount int + State GraphState + type Node struct + ID string + Incoming []*Edge + Outgoing []*Edge + Symbol *ast.Symbol + type PathResult struct + From string + Length int + Path []string + To string + type ProgressFunc func(progress BuildProgress) + type ProgressPhase int + const ProgressPhaseCollecting + const ProgressPhaseExtractingEdges + const ProgressPhaseFinalizing + func (p ProgressPhase) String() string + type QueryOption func(*QueryOptions) + func WithLimit(n int) QueryOption + func WithMaxDepth(d int) QueryOption + func WithTimeout(d time.Duration) QueryOption + type QueryOptions struct + Limit int + MaxDepth int + Timeout time.Duration + func DefaultQueryOptions() QueryOptions + type QueryResult struct + Duration time.Duration + Symbols []*ast.Symbol + Truncated bool + type TraversalResult struct + Depth int + Edges []*Edge + StartNode string + Truncated bool + VisitedNodes []string