contracts

package
v0.2.0-beta Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package contracts defines the interfaces for graph storage.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Stats added in v0.1.8

type Stats struct {
	NodesCount int
	EdgesCount int
	Languages  []string
}

Stats represents repository-wide structural statistics.

type Store

type Store interface {
	SaveNode(ctx context.Context, node *graph.Node) error
	SaveEdge(ctx context.Context, edge *graph.Edge) error
	SaveGraph(ctx context.Context, nodes []*graph.Node, edges []*graph.Edge) error
	GetNode(ctx context.Context, id string) (*graph.Node, error)
	ListNodes(ctx context.Context) ([]*graph.Node, error)
	GetNeighbors(ctx context.Context, id string) ([]*graph.Node, []*graph.Edge, error)
	GetInboundEdges(ctx context.Context, id string) ([]*graph.Node, []*graph.Edge, error)
	GetImpactRecursive(ctx context.Context, id string) ([]*graph.Node, []*graph.Edge, error)
	ListEdges(ctx context.Context) ([]*graph.Edge, error)
	GetStats(ctx context.Context) (*Stats, error)
	DeleteNode(ctx context.Context, id string) error
	DeleteByFile(ctx context.Context, file string) error
	DeleteEdgesFrom(ctx context.Context, id string) error
	Close() error
}

Store defines the interface for persisting and querying the structural graph.

Jump to

Keyboard shortcuts

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