zitadel/internal/eventstore/v2/read_model.go

16 lines
432 B
Go
Raw Normal View History

2020-10-14 10:43:31 +00:00
package eventstore
//ReadModel is the minimum representation of a View model.
// it might be saved in a database or in memory
type ReadModel struct {
ProcessedSequence uint64
ID string
Events []Event
}
//Append adds all the events to the aggregate.
// The function doesn't compute the new state of the read model
func (a *ReadModel) Append(events ...Event) {
a.Events = append(a.Events, events...)
}