query

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

@index Application graph-query policy for callers, imports, inheritance, summaries, and exact-name fallback.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CandidateMatch

type CandidateMatch struct {
	QualifiedName string
	Kind          graph.NodeKind
	FilePath      string
	StartLine     int
}

CandidateMatch describes one exact short-name fallback candidate for query_graph. @intent provide compact, stable target suggestions when a short symbol name matches multiple nodes.

type FileSummary

type FileSummary struct {
	FilePath  string
	Functions int
	Classes   int
	Types     int
	Tests     int
	Total     int
}

FileSummary aggregates node counts for one file. @intent summarize the kinds of graph nodes stored for a source file

type PagedNodes

type PagedNodes struct {
	Nodes      []graph.Node
	TotalCount int
}

@intent carry paginated graph query rows together with the total match count for MCP responses.

type QueryOptions

type QueryOptions struct {
	IncludeFallbackCalls *bool
	Limit                int
	Offset               int
}

QueryOptions controls how predefined relationship lookups treat lower-confidence edges. @intent let callers choose between compatibility mode and strict call-edge analysis.

type Service

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

Service serves predefined graph relationship queries. @intent provide reusable higher-level graph lookups for MCP queries

func New

func New(repository analyzeapp.QueryRepository) *Service

New creates a predefined query service. @intent construct a service for common graph traversal queries

func (*Service) CalleesOf

func (s *Service) CalleesOf(ctx context.Context, nodeID uint) ([]graph.Node, error)

CalleesOf returns nodes called by the target node. @intent find downstream call dependencies of a function or method node @see query.Service.CallersOf

func (*Service) CalleesOfPage

func (s *Service) CalleesOfPage(ctx context.Context, nodeID uint, opts QueryOptions) (PagedNodes, error)

CalleesOfPage returns callees with pagination metadata. @intent support paginated query_graph response pagination and cache metadata.

func (*Service) CalleesOfWithOptions

func (s *Service) CalleesOfWithOptions(ctx context.Context, nodeID uint, opts QueryOptions) ([]graph.Node, error)

CalleesOfWithOptions returns nodes called by the target node with explicit fallback-call control. @intent support strict callee lookups that ignore fallback-derived edges when requested.

func (*Service) CallersOf

func (s *Service) CallersOf(ctx context.Context, nodeID uint) ([]graph.Node, error)

CallersOf returns nodes that call the target node. @intent find upstream callers of a function or method node @see query.Service.CalleesOf

func (*Service) CallersOfPage

func (s *Service) CallersOfPage(ctx context.Context, nodeID uint, opts QueryOptions) (PagedNodes, error)

CallersOfPage returns callers with pagination metadata. @intent support paginated query_graph response pagination and cache metadata.

func (*Service) CallersOfWithOptions

func (s *Service) CallersOfWithOptions(ctx context.Context, nodeID uint, opts QueryOptions) ([]graph.Node, error)

CallersOfWithOptions returns nodes that call the target node with explicit fallback-call control. @intent support strict caller lookups that ignore fallback-derived edges when requested.

func (*Service) ChildrenOf

func (s *Service) ChildrenOf(ctx context.Context, nodeID uint) ([]graph.Node, error)

ChildrenOf returns nodes contained by the target node. @intent enumerate structural children contained within a file or type node

func (*Service) ChildrenOfPage

func (s *Service) ChildrenOfPage(ctx context.Context, nodeID uint, opts QueryOptions) (PagedNodes, error)

ChildrenOfPage returns child nodes with pagination metadata. @intent support paginated query_graph response pagination and cache metadata.

func (*Service) FileSummaryOf

func (s *Service) FileSummaryOf(ctx context.Context, filePath string) (*FileSummary, error)

FileSummaryOf returns node counts grouped by kind for one file. @intent summarize how much graph structure exists within a specific file @param filePath repository-relative source file path to summarize @return per-kind node counts and total node count for the file

func (*Service) FindExactNameMatches

func (s *Service) FindExactNameMatches(ctx context.Context, target string, limit int) ([]CandidateMatch, error)

FindExactNameMatches returns nodes whose short name exactly matches target. @intent support MCP fallback from short symbol names to fully qualified graph nodes.

func (*Service) ImportersOf

func (s *Service) ImportersOf(ctx context.Context, nodeID uint) ([]graph.Node, error)

ImportersOf returns nodes that import the target node. @intent reveal reverse import dependencies pointing at the target node

func (*Service) ImportersOfPage

func (s *Service) ImportersOfPage(ctx context.Context, nodeID uint, opts QueryOptions) (PagedNodes, error)

ImportersOfPage returns importing nodes with pagination metadata. @intent support paginated query_graph response pagination and cache metadata.

func (*Service) ImportsOf

func (s *Service) ImportsOf(ctx context.Context, nodeID uint) ([]graph.Node, error)

ImportsOf returns nodes imported by the target node. @intent reveal outgoing import dependencies for a file or package node

func (*Service) ImportsOfPage

func (s *Service) ImportsOfPage(ctx context.Context, nodeID uint, opts QueryOptions) (PagedNodes, error)

ImportsOfPage returns imported nodes with pagination metadata. @intent support paginated query_graph response pagination and cache metadata.

func (*Service) InheritorsOf

func (s *Service) InheritorsOf(ctx context.Context, nodeID uint) ([]graph.Node, error)

InheritorsOf returns nodes inheriting from the target node. @intent find derived types that point to the target through inheritance edges

func (*Service) InheritorsOfPage

func (s *Service) InheritorsOfPage(ctx context.Context, nodeID uint, opts QueryOptions) (PagedNodes, error)

InheritorsOfPage returns inheritors with pagination metadata. @intent support paginated query_graph response pagination and cache metadata.

func (*Service) TestsFor

func (s *Service) TestsFor(ctx context.Context, nodeID uint) ([]graph.Node, error)

TestsFor returns tests that exercise the target node. @intent find test nodes linked to the target via tested_by edges

func (*Service) TestsForPage

func (s *Service) TestsForPage(ctx context.Context, nodeID uint, opts QueryOptions) (PagedNodes, error)

TestsForPage returns tests with pagination metadata. @intent support paginated query_graph response pagination and cache metadata.

Jump to

Keyboard shortcuts

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