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

query

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Engine

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

Engine wraps a loaded graph and answers queries against it.

func LoadFromFile

func LoadFromFile(graphPath string) (*Engine, error)

LoadFromFile reads graph.json and constructs a query Engine.

func (*Engine) Explain

func (e *Engine) Explain(label string) string

Explain returns all edges where the given node is source or target.

func (*Engine) Graph

func (e *Engine) Graph() *types.Graph

Graph returns the underlying types.Graph (read-only reference).

func (*Engine) NodeByID

func (e *Engine) NodeByID(id string) (types.Node, bool)

NodeByID returns the node with the given ID string, if it exists.

func (*Engine) Path

func (e *Engine) Path(fromLabel, toLabel string) string

Path finds the shortest directed path from nodeA to nodeB. Returns a human-readable string.

func (*Engine) Query

func (e *Engine) Query(input string) string

Query is a freeform dispatcher: parses "path A B", "explain X", etc.

Jump to

Keyboard shortcuts

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