Documentation
¶
Overview ¶
Package snapshot stores periodic snapshots of execution states in KV: a cache that lets a state be rebuilt from the snapshot plus the tail of the log instead of the whole log. Snapshots are never authoritative; a missing or unreadable one just means a longer replay.
Index ¶
Constants ¶
View Source
const DefaultEvery = 100
DefaultEvery is the default number of events between snapshots.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store reads and writes snapshots.
func New ¶
New returns a snapshot store writing every n events (0 = DefaultEvery, negative = never).
func (*Store) Due ¶
Due reports whether a state that went from before to after events should be snapshotted (it crossed a multiple of the interval).
Click to show internal directories.
Click to hide internal directories.