Documentation
¶
Overview ¶
Package state owns the replicator's local watermark file.
The file lives next to the database (default: /data/.zapdb-replicate- state.json). It records the most recent badger version successfully uploaded so a restart resumes the incremental stream where it left off without re-uploading the whole DB.
It is NOT the source of truth — that is the backend's HEAD.json. The state file is just a cheap local cache that lets the daemon skip re-listing the backend on each cycle.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type State ¶
type State struct {
Version int `json:"version"` // schema version (1)
Network string `json:"network"`
LastVersion uint64 `json:"lastVersion"` // badger watermark we last uploaded through
LastSnapshotKind string `json:"lastSnapshotKind"` // "full" | "increment"
LastFullVersion uint64 `json:"lastFullVersion"` // watermark of the most recent full snapshot
LastFullTimestamp time.Time `json:"lastFullTimestamp"` // when the last full snapshot ran
UpdatedAt time.Time `json:"updatedAt"`
}
State is the persisted replicator watermark.
Click to show internal directories.
Click to hide internal directories.