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 ¶
var ErrActNotSupported = ig.ErrActNotSupported
ErrActNotSupported is returned by Graph implementations that do not support actions.
var ErrNotFound = ig.ErrNotFound
ErrNotFound is returned when a node ID does not exist in the graph.
var NewCompositeGraph = ig.NewCompositeGraph
NewCompositeGraph creates an empty composite graph for multi-mount routing.
var NewHotSwapGraph = ig.NewHotSwapGraph
NewHotSwapGraph creates a thread-safe graph wrapper that supports atomic Swap.
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 ¶
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 ¶
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.