memory

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrCouldNotSaveAggregate = errors.New("could not save aggregate")

ErrCouldNotSaveAggregate is when an aggregate could not be saved.

Functions

This section is empty.

Types

type EventStore

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

EventStore implements EventStore as an in memory structure.

func NewEventStore

func NewEventStore() *EventStore

NewEventStore creates a new EventStore using memory as storage.

func (*EventStore) Load

func (s *EventStore) Load(ctx context.Context, id uuid.UUID) ([]eh.Event, error)

Load implements the Load method of the eventhorizon.EventStore interface.

func (*EventStore) LoadAll added in v0.8.0

func (s *EventStore) LoadAll(ctx context.Context) ([]eh.AggregateRecord, error)

func (*EventStore) RenameEvent

func (s *EventStore) RenameEvent(ctx context.Context, from, to eh.EventType) error

RenameEvent implements the RenameEvent method of the eventhorizon.EventStore interface.

func (*EventStore) Replace

func (s *EventStore) Replace(ctx context.Context, event eh.Event) error

Replace implements the Replace method of the eventhorizon.EventStore interface.

func (*EventStore) Save

func (s *EventStore) Save(ctx context.Context, events []eh.Event, originalVersion int) error

Save implements the Save method of the eventhorizon.EventStore interface.

Jump to

Keyboard shortcuts

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