mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 00:47:33 +00:00
perf: query data AS OF SYSTEM TIME
(#5231)
Queries the data in the storage layser at the timestamp when the call hit the API layer
This commit is contained in:
@@ -2,7 +2,7 @@ package eventstore
|
||||
|
||||
import "time"
|
||||
|
||||
//ReadModel is the minimum representation of a read model.
|
||||
// ReadModel is the minimum representation of a read model.
|
||||
// It implements a basic reducer
|
||||
// it might be saved in a database or in memory
|
||||
type ReadModel struct {
|
||||
@@ -15,14 +15,13 @@ type ReadModel struct {
|
||||
InstanceID string `json:"-"`
|
||||
}
|
||||
|
||||
//AppendEvents adds all the events to the read model.
|
||||
// AppendEvents adds all the events to the read model.
|
||||
// The function doesn't compute the new state of the read model
|
||||
func (rm *ReadModel) AppendEvents(events ...Event) *ReadModel {
|
||||
func (rm *ReadModel) AppendEvents(events ...Event) {
|
||||
rm.Events = append(rm.Events, events...)
|
||||
return rm
|
||||
}
|
||||
|
||||
//Reduce is the basic implementation of reducer
|
||||
// Reduce is the basic implementation of reducer
|
||||
// If this function is extended the extending function should be the last step
|
||||
func (rm *ReadModel) Reduce() error {
|
||||
if len(rm.Events) == 0 {
|
||||
|
Reference in New Issue
Block a user