Help us shape the future of Go! Take the 2026 Go Developer Survey

graph

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package graph implements deterministic queries over evidence-bearing snapshots.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Graph

type Graph struct {
	Nodes map[string]model.Node
	Edges []model.Edge
	// contains filtered or unexported fields
}

func New

func New(s model.Snapshot) (*Graph, error)

func (*Graph) Distances

func (g *Graph) Distances(start, kind string, reverse bool, maxDepth int) []Hop

Distances runs a breadth-first traversal from start, optionally limited to maxDepth hops (0 means unlimited). start itself is not included.

func (*Graph) Mermaid

func (g *Graph) Mermaid() string

func (*Graph) Reachable

func (g *Graph) Reachable(start, kind string, reverse bool) []model.Node

Reachable follows only recorded edges, never infers runtime reachability.

func (*Graph) Resolve

func (g *Graph) Resolve(query, kind string) []model.Node

Resolve finds entities for a human query: an exact ID, a "path#qualified" suffix, a repository path, or a case-insensitive name/qualified-name match.

func (*Graph) Select

func (g *Graph) Select(kind, name string) []model.Node

type Hop

type Hop struct {
	ID    string `json:"id"`
	Depth int    `json:"depth"`
	Via   string `json:"via,omitempty"`
}

Hop is a node reached by traversal with its distance and predecessor.

Jump to

Keyboard shortcuts

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