memory

package
v0.7.17 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2026 License: AGPL-3.0 Imports: 6 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 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 NewLoader added in v0.7.0

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

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

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.

type Store added in v0.7.0

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

Store implements ports.StateStore in memory. Safe for concurrent use.

func NewStore added in v0.7.0

func NewStore() *Store

NewStore creates a new in-memory store.

func (*Store) Delete added in v0.7.0

func (s *Store) Delete(ctx context.Context, sessionID string) error

Delete removes the state.

func (*Store) List added in v0.7.0

func (s *Store) List(ctx context.Context) ([]string, error)

List returns active sessions.

func (*Store) Load added in v0.7.0

func (s *Store) Load(ctx context.Context, sessionID string) (*domain.State, error)

Load retrieves the state from memory.

func (*Store) Save added in v0.7.0

func (s *Store) Save(ctx context.Context, sessionID string, state *domain.State) error

Save persists the state in memory.

Jump to

Keyboard shortcuts

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