Documentation ¶
Index ¶
- type EventModifier
- type Publisher
- type Store
- func (m *Store) Events(_ context.Context, fromID int, c chan eventsourced.Event, ...) error
- func (m *Store) GetAggregateRoots(_ context.Context, aggregateType reflect.Type) ([]eventsourced.ID, error)
- func (m *Store) GetEvents(_ context.Context, aggregate eventsourced.Aggregate, ...) ([]eventsourced.EventWrapper, error)
- func (m *Store) MaxGlobalSequenceNo(ctx context.Context) (int, error)
- func (m *Store) RestoreSnapshot(_ context.Context, aggregate eventsourced.Aggregate) (eventsourced.Snapshot, error)
- func (m *Store) StoreEvent(_ context.Context, aggregate eventsourced.Aggregate, event eventsourced.Event, ...) error
- func (m *Store) StoreSnapshot(_ context.Context, aggregate eventsourced.Aggregate, sequenceNo int) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventModifier ¶ added in v0.6.2
type EventModifier func(event eventsourced.Event)
type Publisher ¶ added in v0.0.2
type Publisher struct { PublishFunc func(event eventsourced.Event) error // contains filtered or unexported fields }
Publisher is a mock implementation of eventsourced.EventPublisher
func (*Publisher) AssertPublished ¶ added in v0.0.2
func (p *Publisher) AssertPublished(t testing.TB, want []eventsourced.Event, modifiers ...EventModifier)
AssertPublished checks that the expected events were published
type Store ¶
type Store struct { RestoreSnapshotFunc func(aggregate eventsourced.Aggregate) (eventsourced.Snapshot, error) StoreSnapshotFunc func(aggregate eventsourced.Aggregate, sequenceNo int) error GetEventsFunc func(aggregate eventsourced.Aggregate, sinceSnapshot eventsourced.Snapshot) ([]eventsourced.EventWrapper, error) StoreEventFunc func( aggregate eventsourced.Aggregate, event eventsourced.Event, sequenceNo int, newAggregate bool, ) error GetAggregateRootsFunc func(aggregateType reflect.Type) ([]eventsourced.ID, error) EventsFunc func(fromID int, c chan eventsourced.Event, aggregateTypes ...eventsourced.Aggregate) error MaxGlobalSeqNoFunc func(ctx context.Context) (int, error) }
Store is a mock implementation of eventsourced.EventStore
func (*Store) Events ¶ added in v0.0.5
func (m *Store) Events(_ context.Context, fromID int, c chan eventsourced.Event, aggregateTypes ...eventsourced.Aggregate) error
Events mocks eventsourced.EventStore.Events by calling EventsFunc or by returning nil if EventsFunc is nil
func (*Store) GetAggregateRoots ¶
func (m *Store) GetAggregateRoots(_ context.Context, aggregateType reflect.Type) ([]eventsourced.ID, error)
GetAggregateRoots mocks eventsourced.EventStore.GetAggregateRoots by calling GetAggregateRootsFunc or by returning nil, nil if GetAggregateRootsFunc is nil
func (*Store) GetEvents ¶
func (m *Store) GetEvents(_ context.Context, aggregate eventsourced.Aggregate, sinceSnapshot eventsourced.Snapshot) ([]eventsourced.EventWrapper, error)
GetEvents mocks eventsourced.EventStore.GetEvents by calling GetEventsFunc or by returning nil, nil if GetEventsFunc is nil
func (*Store) MaxGlobalSequenceNo ¶ added in v0.6.0
func (*Store) RestoreSnapshot ¶ added in v0.5.0
func (m *Store) RestoreSnapshot(_ context.Context, aggregate eventsourced.Aggregate) (eventsourced.Snapshot, error)
RestoreSnapshot mocks eventsourced.EventStore.RestoreSnapshot by calling RestoreSnapshotFunc or by returning nil, nil if RestoreSnapshotFunc is nil
func (*Store) StoreEvent ¶
func (m *Store) StoreEvent( _ context.Context, aggregate eventsourced.Aggregate, event eventsourced.Event, sequenceNo int, newAggregate bool, ) error
StoreEvent mocks eventsourced.EventStore.StoreEvent by calling StoreEventFunc or by returning 0, nil if StoreEventFunc is nil
func (*Store) StoreSnapshot ¶
func (m *Store) StoreSnapshot(_ context.Context, aggregate eventsourced.Aggregate, sequenceNo int) error
StoreSnapshot mocks eventsourced.EventStore.StoreSnapshot by calling StoreSnapshotFunc or by returning nil if StoreSnapshotFunc is nil