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

export

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 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 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 WriteObsidian

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

WriteObsidian creates an Obsidian vault at outDir/obsidian/.

Vault layout:

obsidian/
  Memories/                       ← ancora memory root
    _index/                       ← workspace + visibility hub notes
      workspace-glim.md
      visibility-work.md
    glim/                         ← one folder per workspace
      work/                       ← one subfolder per visibility
        Fixed auth bug.md         ← rich frontmatter observation note
      personal/
    ancora/
      work/
  Projects/                       ← codebase extractions
    vela/                         ← one folder per project
      _index.md                   ← project root note
      internal_auth_middleware.go.md
    glim/
  _root/                          ← memory_source and project root nodes

Edges between memories and code (cross-source references) are written as wikilinks so Obsidian graph view draws connections between the two domains.

func WriteObsidianConfig

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

WriteObsidianConfig writes .obsidian/graph.json with 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.

Types

This section is empty.

Jump to

Keyboard shortcuts

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