inmemory

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2026 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Loader

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

Loader implements ports.GraphLoader using an in-memory map.

func New

func New(data map[string]string) *Loader

New creates a new MemoryLoader with the provided raw data (JSON strings).

func NewFromNodes

func NewFromNodes(nodes ...domain.Node) (*Loader, error)

NewFromNodes creates a new MemoryLoader from domain objects. This handles serialization automatically, improving DX for tests.

func (*Loader) GetNode

func (l *Loader) GetNode(id string) ([]byte, error)

GetNode retrieves the raw definition of a node by ID.

func (*Loader) ListNodes

func (l *Loader) ListNodes() ([]string, error)

ListNodes returns all available node IDs.

Jump to

Keyboard shortcuts

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