Documentation
¶
Overview ¶
Package snapshot is the platform-store snapshot seam (ADR-0202): each platform store (the event store, the metastore, the run state) reads its whole content in one read transaction as a Source, and an empty store of the same port fills from such a stream as a Loader. Cut reads the three stores in the order that makes the gap between them safe; ADR-0203 writes what it emits.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Cut ¶
func Cut(ctx context.Context, events, meta, runs Source, emit func(src Source, r Record) error) (string, error)
Cut snapshots events, meta, then runs, back to back, emitting each record with its source, and returns meta's resourceVersion; the first error ends it (ADR-0202 Decision 2). A later read sees every commit an earlier one saw: a WorkflowRun in the cut has its run record, and an event fired between the reads replays rather than being lost.
Types ¶
type Loader ¶
Loader writes the records next returns, until io.EOF, in bounded batches; a non-empty store gets fault.Conflict before any write. Load is not atomic: after a failed Load the store is unusable and the caller discards it.
type Record ¶
type Record struct{ Key, Value []byte }
Record is one entry of a store, its key and its latest value as stored.
Directories
¶
| Path | Synopsis |
|---|---|
|
Package badger snapshots and loads a whole Badger instance for the platform stores built on one (ADR-0202), the metastore engine and the run state, so each reads in one transaction alike.
|
Package badger snapshots and loads a whole Badger instance for the platform stores built on one (ADR-0202), the metastore engine and the run state, so each reads in one transaction alike. |
|
Package snapshotcontract is the shared conformance suite for snapshot.Source and snapshot.Loader (ADR-0202): every platform store runs it, on disk and in memory, so each one snapshots in one read and loads back alike.
|
Package snapshotcontract is the shared conformance suite for snapshot.Source and snapshot.Loader (ADR-0202): every platform store runs it, on disk and in memory, so each one snapshots in one read and loads back alike. |