store

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

@index Collection of abstract interfaces for graph storage (nodes/edges/annotations).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnnotationStore

type AnnotationStore interface {
	UpsertAnnotation(ctx context.Context, ann *model.Annotation) error
	GetAnnotation(ctx context.Context, nodeID uint) (*model.Annotation, error)
}

AnnotationStore defines annotation storage functionality. @intent abstract the storage and lookup of structured comments per node.

type EdgeStore

type EdgeStore interface {
	UpsertEdges(ctx context.Context, edges []model.Edge) error
	GetEdgesFrom(ctx context.Context, nodeID uint) ([]model.Edge, error)
	GetEdgesFromNodes(ctx context.Context, nodeIDs []uint) ([]model.Edge, error)
	GetEdgesTo(ctx context.Context, nodeID uint) ([]model.Edge, error)
	GetEdgesToNodes(ctx context.Context, nodeIDs []uint) ([]model.Edge, error)
	DeleteEdgesByFile(ctx context.Context, filePath string) error
}

EdgeStore defines edge storage and lookup functionality. @intent Provides a consistent interface for reading and writing graph relationships.

type GraphStore

type GraphStore interface {
	NodeReader
	NodeWriter
	EdgeStore
	AnnotationStore

	WithTx(ctx context.Context, fn func(store GraphStore) error) error
	AutoMigrate() error
}

GraphStore is the unified contract for the graph repository. @intent Provides node, edge, annotation, and transaction functionality in one place.

type NodeReader

type NodeReader interface {
	GetNode(ctx context.Context, qualifiedName string) (*model.Node, error)
	GetNodeByID(ctx context.Context, id uint) (*model.Node, error)
	GetNodesByIDs(ctx context.Context, ids []uint) ([]model.Node, error)
	GetNodesByQualifiedNames(ctx context.Context, names []string) (map[string][]model.Node, error)
	GetNodesByFile(ctx context.Context, filePath string) ([]model.Node, error)
	GetNodesByFiles(ctx context.Context, filePaths []string) (map[string][]model.Node, error)
}

NodeReader defines node lookup functionality. @intent Provides a contract for reading graph nodes by identifier and file.

type NodeWriter

type NodeWriter interface {
	UpsertNodes(ctx context.Context, nodes []model.Node) error
	DeleteNodesByFile(ctx context.Context, filePath string) error
	DeleteGraph(ctx context.Context) error
}

NodeWriter defines node writing functionality. @intent abstract the storage of graph nodes and deletion on a per-file basis.

Directories

Path Synopsis
@index GORM-based graph repository that manages CRUD operations and transactions for nodes, edges, and annotations.
@index GORM-based graph repository that manages CRUD operations and transactions for nodes, edges, and annotations.
@index Shared search backend interface and errors for SQLite FTS5 and PostgreSQL tsvector implementations.
@index Shared search backend interface and errors for SQLite FTS5 and PostgreSQL tsvector implementations.

Jump to

Keyboard shortcuts

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