Documentation
¶
Overview ¶
Package schemaver stamps and verifies a persistence schema version inside each service's bbolt database. Every store writes plain JSON structs into bbolt buckets; without a version marker, loading data written by a different binary could silently corrupt (a renamed or semantically-changed field deserializes into the wrong shape). Ensure records the current version on first use and, on later opens, refuses a database written by a newer schema rather than misread it.
Index ¶
Constants ¶
const Current uint32 = 1
Current is the schema version every store writes today. Bump it (and add a migration in Ensure) when a persisted struct changes incompatibly.
Variables ¶
This section is empty.
Functions ¶
func Ensure ¶
Ensure verifies (or, on a fresh/pre-versioning database, stamps) the schema version. service names the store for error messages. An unversioned database is treated as Current and stamped in place (existing data is v1). A database written by a newer schema is rejected — refusing to load is safer than silently misinterpreting fields.
Types ¶
This section is empty.