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

export

package
v1.12.1 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2026 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const ChildDiscoveryFingerprint = generation.ChildDiscoveryFingerprint
View Source
const DiscoveryFingerprint = generation.DiscoveryFingerprint
View Source
const ExtractorFingerprint = generation.ExtractorFingerprint
View Source
const InventoryVersion = generation.InventoryVersion

Variables

View Source
var PublicationBoundaries = []string{
	"generation_directory", "output_directory_sync", "stage_directory", "json_write", "json_sync",
	"sqlite_write", "sqlite_sync", "manifest_write", "manifest_sync", "validate_artifacts",
	"seal_write", "seal_sync", "stage_directory_sync", "generation_rename", "generations_directory_sync", "validate_generation",
	"aliases", "aliases_directory_sync", "selection_create", "selection_directory_sync", "selection_rename", "selected_directory_sync",
}

Functions

func CanonicalRoot added in v1.12.0

func CanonicalRoot(root string) (string, error)

func CheckInventory added in v1.12.0

func CheckInventory(m *types.Manifest) ([]string, error)

func ChildNamespace added in v1.12.0

func ChildNamespace(root string) string

func DiscoverChildRoots added in v1.12.0

func DiscoverChildRoots(root string) ([]string, error)

func GraphDigest added in v1.12.0

func GraphDigest(g *types.Graph) string

GraphDigest hashes the persisted JSON semantics, excluding wall-clock export timestamps. Used to bind pipeline return values and self-contained children.

func Inventory added in v1.12.0

func Inventory(root string, r types.ManifestRequest) (*types.Manifest, []string, error)

func LoadJSON added in v1.4.0

func LoadJSON(path string) (*types.Graph, error)

LoadJSON reads a graph.json file written by WriteJSON/WriteJSONAtomic.

func LoadManifest added in v1.7.1

func LoadManifest(path string) (*types.Manifest, error)

LoadManifest reads a manifest.json file written by WriteManifestAtomic.

func NamespaceChild added in v1.12.0

func NamespaceChild(root string, g *types.Graph) *types.Graph

NamespaceChild keeps each child's graph independently reconstructable, even when basenames, relative file paths, labels, and original node IDs collide.

func PushNeo4j

func PushNeo4j(g *types.Graph, boltURL, username, password string) error

PushNeo4j connects to the Neo4j instance at boltURL and writes all nodes and edges from g. Existing data is NOT cleared — nodes and edges are merged using MERGE to make the operation idempotent.

Returns a clear error if Neo4j is unreachable (not a panic).

func RequestFingerprint added in v1.12.0

func RequestFingerprint(r types.ManifestRequest) string

func WriteHTML

func WriteHTML(g *types.Graph, outDir string) error

WriteHTML generates an interactive vis.js Network graph as a self-contained HTML file at outDir/graph.html. Nodes are coloured by community ID; god nodes (high degree) are rendered larger.

func WriteJSON

func WriteJSON(g *types.Graph, outDir string) error

WriteJSON serialises g to <outDir>/graph.json, creating outDir if necessary.

func WriteJSONAtomic added in v1.3.0

func WriteJSONAtomic(g *types.Graph, outDir string) error

WriteJSONAtomic serialises g to <outDir>/graph.json atomically using a temp file + rename so a crash mid-write leaves the previous file intact.

func WriteManifestAtomic added in v1.7.1

func WriteManifestAtomic(m *types.Manifest, outDir string) error

WriteManifestAtomic writes <outDir>/manifest.json atomically.

func WriteObsidian

func WriteObsidian(g *types.Graph, outDir string) error

WriteObsidian creates Obsidian vault exports under outDir/obsidian/.

Repos with organization metadata are split into org-scoped vaults under obsidian/Organizations/<org>/ so each org can be opened as its own vault, with repos written directly under that org vault root. Repos without organization metadata keep the legacy combined layout under obsidian/Projects/.

Each org vault duplicates memory notes so cross-source wikilinks remain self-contained inside that vault instead of pointing outside it.

func WriteObsidianConfig

func WriteObsidianConfig(g *types.Graph, outDir string) error

WriteObsidianConfig writes .obsidian/graph.json for the default vault at outDir/obsidian using colorGroups derived from the graph's node types and workspace/project structure.

Group priority (Obsidian first-match wins):

  1. Memories/_root — amber memory source root
  2. Memories/_index — gold workspace/visibility index notes
  3. Memories/*/work — teal (work-scoped observations)
  4. Memories/*/personal — rose (personal observations)
  5. Memories/*/ — workspace catch-all
  6. Projects/<name>/_index — project root (per-project color)
  7. Projects/<name>/ — code symbols catch-all

Physics settings are preserved from existing graph.json if present.

func WriteSQLiteGraphAtomic added in v1.7.3

func WriteSQLiteGraphAtomic(g *types.Graph, outDir string) error

WriteSQLiteGraphAtomic writes <outDir>/graph.db as the v0.4 runtime graph store. The first schema slice intentionally persists only the graph facts needed by the build/runtime artifact contract; later query scenarios can add traversal-specific tables without making graph.json runtime truth again.

Types

type Snapshot added in v1.12.0

type Snapshot struct {
	ID       string
	Dir      string
	Graph    *types.Graph
	Manifest *types.Manifest
	Sequence uint64
}

Snapshot owns an immutable, validated graph/manifest pair. Generations are deliberately never garbage collected yet: process-independent pinned readers and copied aggregate provenance are safe without a reader lease protocol.

func ResolveGeneration added in v1.12.0

func ResolveGeneration(out string) (*Snapshot, error)

ResolveGeneration reads selection once. An absent pointer in an adopted layout, invalid pointer, or corrupt generation is unavailable, never legacy.

func ValidateGeneration added in v1.12.0

func ValidateGeneration(dir string) (*Snapshot, error)

type Writer added in v1.12.0

type Writer struct {
	Dir string

	// Per-instance failure injection; never global and never configured by CLI.
	Fault func(string) error
	// contains filtered or unexported fields
}

func AcquireWriter added in v1.12.0

func AcquireWriter(ctx context.Context, out string) (*Writer, error)

AcquireWriter serializes all cooperating processes targeting the canonical output directory. The stable lock inode is NEVER unlinked (including restart).

func (*Writer) Close added in v1.12.0

func (w *Writer) Close() error

func (*Writer) Publish added in v1.12.0

func (w *Writer) Publish(g *types.Graph, manifest *types.Manifest, persist func(*types.Graph, string) error) (*Snapshot, error)

Publish stages all artifacts, validates them, seals their exact bytes, fsyncs artifacts and directory entries, then atomically renames ONE selection link. A failure after selection rename may expose the complete new generation. It must never be "rolled back" using an earlier CLI byte snapshot.

func (*Writer) Recover added in v1.12.0

func (w *Writer) Recover() (*Snapshot, error)

Recover is an explicit internal writer operation, never a read-side repair. Only fully sealed final directories qualify; staging is always ignored.

Jump to

Keyboard shortcuts

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