resolver

package
v0.3.4 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Resolve

func Resolve(st RefResolver) error

func ResolveWorkspace added in v0.2.0

func ResolveWorkspace(projects []ProjectRef) error

ResolveWorkspace performs a second-pass cross-project wikilink resolution after all per-project Resolve() calls have completed. It handles [project/doc-name] formatted wikilinks that could not be resolved within a single project. Because edges.target has a FOREIGN KEY constraint that references nodes in the same DB, cross-project edges use the same self-edge-with-metadata pattern as links_external: Source == Target == ref.FromNodeID, with {"cross_project": true, "target_project": "...", "target_node_id": "..."} stored in Metadata.

Types

type ProjectRef added in v0.2.0

type ProjectRef struct {
	Name  string
	Store *store.Store
}

ProjectRef is a lightweight project descriptor used by ResolveWorkspace to avoid a circular import between resolver and workspace packages.

type RefResolver added in v0.3.2

type RefResolver interface {
	GetAllDocumentNodes() ([]store.Node, error)
	GetUnresolvedRefs() ([]store.UnresolvedRef, error)
	InsertEdges(edges []store.Edge) error
	InsertUnresolvedRefs(refs []store.UnresolvedRef) error
	DeleteAllUnresolvedRefs() error
	GetNodeByID(id string) (*store.Node, error)
}

RefResolver is the narrow slice of *store.Store that the reference resolver actually needs. It decouples resolver from the 125-method *store.Store god type: callers pass a concrete *store.Store (which auto-satisfies this subset), but the resolver only depends on these six methods. This shrinks the blast radius of store API changes on the resolver and documents the true dependency surface.

Jump to

Keyboard shortcuts

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