refactor(eventstore): rename EventPusher to Command, EventReader to Event, PushEvents to Push and FilterEvents to Filter (#2907)

This commit is contained in:
Silvan
2022-01-03 09:19:07 +01:00
committed by GitHub
parent 9a374f9c5c
commit 09be70949f
339 changed files with 1436 additions and 1346 deletions

View File

@@ -6,16 +6,16 @@ import "time"
// It implements a basic reducer
// it's purpose is to reduce events to create new ones
type WriteModel struct {
AggregateID string `json:"-"`
ProcessedSequence uint64 `json:"-"`
Events []EventReader `json:"-"`
ResourceOwner string `json:"-"`
ChangeDate time.Time `json:"-"`
AggregateID string `json:"-"`
ProcessedSequence uint64 `json:"-"`
Events []Event `json:"-"`
ResourceOwner string `json:"-"`
ChangeDate time.Time `json:"-"`
}
//AppendEvents adds all the events to the read model.
// The function doesn't compute the new state of the read model
func (rm *WriteModel) AppendEvents(events ...EventReader) {
func (rm *WriteModel) AppendEvents(events ...Event) {
rm.Events = append(rm.Events, events...)
}
@@ -38,6 +38,6 @@ func (wm *WriteModel) Reduce() error {
// all events processed and not needed anymore
wm.Events = nil
wm.Events = []EventReader{}
wm.Events = []Event{}
return nil
}