snapshot.go
1package entity
2
3// Snapshot is the minimal interface that a snapshot need to implement
4type Snapshot interface {
5 // AllOperations returns all the operations that have been applied to that snapshot, in order
6 AllOperations() []Operation
7 // AppendOperation add an operation in the list
8 AppendOperation(op Operation)
9}
10
11type CompileToSnapshot[SnapT Snapshot] interface {
12 // Compile an Entity in an easily usable snapshot
13 Compile() SnapT
14}