graph

package
v0.5.6 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package graph provides the public graph API for mache.

Types are defined in internal/graph and re-exported here via type aliases so that external consumers (e.g. x-ray) can use mache's in-memory graph without importing internal packages.

Index

Constants

This section is empty.

Variables

View Source
var ErrActNotSupported = ig.ErrActNotSupported

ErrActNotSupported is returned by Graph implementations that do not support actions.

View Source
var ErrNotFound = ig.ErrNotFound

ErrNotFound is returned when a node ID does not exist in the graph.

View Source
var NewCompositeGraph = ig.NewCompositeGraph

NewCompositeGraph creates an empty composite graph for multi-mount routing.

View Source
var NewHotSwapGraph = ig.NewHotSwapGraph

NewHotSwapGraph creates a thread-safe graph wrapper that supports atomic Swap.

View Source
var NewMemoryStore = ig.NewMemoryStore

NewMemoryStore creates a new in-memory graph store.

Functions

func ExportSQLite added in v0.4.0

func ExportSQLite(store *MemoryStore, dbPath string) error

ExportSQLite writes all nodes from a MemoryStore to a SQLite database. Creates the nodes table if it doesn't exist. Existing entries are overwritten. The resulting file uses the standard mache nodes table schema.

Types

type ActionResult added in v0.5.0

type ActionResult = ig.ActionResult

ActionResult is returned when an action is performed on a graph node.

type CallExtractor

type CallExtractor = ig.CallExtractor

CallExtractor parses source code and returns qualified function call tokens.

type CompositeGraph added in v0.5.0

type CompositeGraph = ig.CompositeGraph

CompositeGraph multiplexes multiple Graph backends under path prefixes. Mount "browser" → /browser/... routes to that sub-graph.

type ContentRef

type ContentRef = ig.ContentRef

ContentRef is a recipe for lazily resolving file content from a backing store.

type ContentResolverFunc

type ContentResolverFunc = ig.ContentResolverFunc

ContentResolverFunc resolves a ContentRef into byte content.

type Graph

type Graph = ig.Graph

Graph is the interface for the FUSE layer and external consumers. Allows swapping the backend (Memory → SQLite → Mmap).

type HotSwapGraph added in v0.5.2

type HotSwapGraph = ig.HotSwapGraph

HotSwapGraph is a thread-safe wrapper that allows atomically swapping the underlying graph. Readers hold an RLock during each call; Swap acquires a write lock. Use this instead of hand-rolled mutex+pointer patterns.

type MemoryStore

type MemoryStore = ig.MemoryStore

MemoryStore is an in-memory implementation of Graph with roaring bitmap indexing.

func ImportSQLite added in v0.4.0

func ImportSQLite(dbPath string) (*MemoryStore, error)

ImportSQLite reads nodes from a SQLite database into a new MemoryStore. The database must have a nodes table in the standard mache format.

type Node

type Node = ig.Node

Node is the universal primitive for files and directories. The Mode field declares whether this is a file or directory.

type QualifiedCall

type QualifiedCall = ig.QualifiedCall

QualifiedCall represents a function call with optional package qualifier.

type SourceOrigin

type SourceOrigin = ig.SourceOrigin

SourceOrigin tracks the byte range of a construct in its source file.

Jump to

Keyboard shortcuts

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