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

memory

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SchemaVersionPhase1  = 1
	SchemaVersionCurrent = 2 // repo_uri secondary index (SYN-11)
)

Schema versions for the in-memory / Badger graph stores.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store struct {
	// contains filtered or unexported fields
}

Store is an in-memory graph.Store for tests and fast local use.

func New

func New() *Store

New returns an empty in-memory store.

func (*Store) Close

func (s *Store) Close() error

func (*Store) DeleteEdge

func (s *Store) DeleteEdge(from graph.NodeID, to graph.NodeID, edgeType graph.EdgeType) error

func (*Store) DeleteFingerprint

func (s *Store) DeleteFingerprint(path string) error

DeleteFingerprint removes the fingerprint for path.

func (*Store) DeleteNode

func (s *Store) DeleteNode(id graph.NodeID) error

func (*Store) DeleteOwnedNodes

func (s *Store) DeleteOwnedNodes(path string) error

DeleteOwnedNodes removes ownership metadata for path.

func (*Store) EnsureSchema

func (s *Store) EnsureSchema(repo string) error

EnsureSchema migrates nodes to schema v2 (repo_uri props + index) using repo. Migration is applied atomically: on conflict/error the store state is unchanged.

func (*Store) ForEachNode

func (s *Store) ForEachNode(fn func(graph.Node) bool) error

ForEachNode invokes fn for every node. Iteration stops early if fn returns false.

func (*Store) GetFingerprint

func (s *Store) GetFingerprint(path string) (string, bool, error)

GetFingerprint returns the stored content hash for path.

func (*Store) GetNode

func (s *Store) GetNode(id graph.NodeID) (graph.Node, error)

func (*Store) GetNodeByURI

func (s *Store) GetNodeByURI(repoURI string) (graph.Node, error)

func (*Store) GetOwnedNodes

func (s *Store) GetOwnedNodes(path string) ([]graph.NodeID, error)

GetOwnedNodes returns node IDs owned by path.

func (*Store) InEdges

func (s *Store) InEdges(to graph.NodeID, edgeType graph.EdgeType) ([]graph.Edge, error)

func (*Store) ListFingerprints

func (s *Store) ListFingerprints() (map[string]string, error)

ListFingerprints returns all path→hash entries.

func (*Store) OutEdges

func (s *Store) OutEdges(from graph.NodeID, edgeType graph.EdgeType) ([]graph.Edge, error)

func (*Store) PutEdge

func (s *Store) PutEdge(edge graph.Edge) error

func (*Store) PutFingerprint

func (s *Store) PutFingerprint(path, hash string) error

PutFingerprint stores a content hash for path.

func (*Store) PutNode

func (s *Store) PutNode(node graph.Node) error

func (*Store) PutOwnedNodes

func (s *Store) PutOwnedNodes(path string, ids []graph.NodeID) error

PutOwnedNodes stores the set of node IDs owned by path.

func (*Store) SchemaVersion

func (s *Store) SchemaVersion() int

SchemaVersion returns the store schema version.

Jump to

Keyboard shortcuts

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