store

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: May 1, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package store provides in-memory implementations of models.Store for use in tests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Memory

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

Memory is a thread-safe in-memory implementation of models.Store. Only for testing.

func New

func New() *Memory

New returns an empty Memory store.

func (*Memory) Append

func (s *Memory) Append(ctx context.Context, aggregateID string, version int64, data []byte) error

func (*Memory) Count

func (s *Memory) Count(ctx context.Context, aggregateID string, fromVersion int64) (int64, error)

func (*Memory) Delete added in v0.4.0

func (s *Memory) Delete(ctx context.Context, aggregateID string) error

func (*Memory) ReadFrom

func (s *Memory) ReadFrom(ctx context.Context, aggregateID string, fromVersion int64) ([][]byte, error)

func (*Memory) ReadRange

func (s *Memory) ReadRange(ctx context.Context, aggregateID string, fromVersion, count int64) ([][]byte, error)

func (*Memory) SetError

func (s *Memory) SetError(aggregateID string, err error)

SetError schedules a one-shot error for the next Append call on aggregateID. The error is consumed and removed after the first matching Append.

Jump to

Keyboard shortcuts

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