Documentation ¶
Index ¶
- type EventStore
- func (s *EventStore) Close() error
- func (s *EventStore) Load(ctx context.Context, id uuid.UUID) ([]eh.Event, error)
- func (s *EventStore) RenameEvent(ctx context.Context, from, to eh.EventType) error
- func (s *EventStore) Replace(ctx context.Context, event eh.Event) error
- func (s *EventStore) Save(ctx context.Context, events []eh.Event, originalVersion int) error
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventStore ¶
type EventStore struct {
// contains filtered or unexported fields
}
EventStore is an eventhorizon.EventStore where all events are stored in memory and not persisted. Useful for testing and experimenting.
func NewEventStore ¶
func NewEventStore(options ...Option) (*EventStore, error)
NewEventStore creates a new EventStore using memory as storage.
func (*EventStore) Close ¶ added in v0.14.8
func (s *EventStore) Close() error
Close implements the Close method of the eventhorizon.EventStore interface.
func (*EventStore) RenameEvent ¶
RenameEvent implements the RenameEvent method of the eventhorizon.EventStore interface.
type Option ¶ added in v0.13.0
type Option func(*EventStore) error
Option is an option setter used to configure creation.
func WithEventHandler ¶ added in v0.13.0
func WithEventHandler(h eh.EventHandler) Option
WithEventHandler adds an event handler that will be called when saving events. An example would be to add an event bus to publish events.
Click to show internal directories.
Click to hide internal directories.