refactor(api): replace map[string]uint64 with api.StoreVersion for store version handling

This commit is contained in:
Pasha Sviderski committed 2026-09-30 16:43:46 +10:00
1 parent e4455e936a
commit e50c5fbe57
8 files changed
+37 -22

No files matched your search

+14
View File
@@ -0,0 +1,14 @@
package api
// StoreVersion records the highest processed database version for each Corrosion actor UUID.
// A version can include changes that were superseded, so it does not guarantee that all data
// through that version is available locally.
type StoreVersion map[string]uint64
// MergeMax keeps the highest observed version for each actor in other.
// The receiver must be initialised before calling MergeMax.
func (v StoreVersion) MergeMax(other StoreVersion) {
for actor, version := range other {
v[actor] = max(v[actor], version)
}
}