Documentation
¶
Overview ¶
Package fixture provides read/write support for .loopfix fixture files.
A .loopfix file is a gzipped JSONL file:
- Line 1: header JSON {version, loopName, configHash, recordedAt, loopkitVersion}
- Lines 2..n: event envelopes in canonical JSON (sorted keys)
Usage:
traj := []event.Envelope{...}
if err := fixture.Save("run.loopfix", "my-loop", "", traj); err != nil { ... }
header, envelopes, err := fixture.Load("run.loopfix")
Index ¶
Constants ¶
View Source
const LoopkitVersion = "0.1.0-sp4"
LoopkitVersion is the version of this loopkit build.
View Source
const Version = "1"
Version is the current .loopfix format version.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ErrCorrupt ¶
type ErrCorrupt struct {
Cause error
}
ErrCorrupt is returned when the gzip or JSONL structure is invalid.
func (*ErrCorrupt) Error ¶
func (e *ErrCorrupt) Error() string
func (*ErrCorrupt) Unwrap ¶
func (e *ErrCorrupt) Unwrap() error
type ErrVersionMismatch ¶
ErrVersionMismatch is returned when the file version does not match Version.
func (*ErrVersionMismatch) Error ¶
func (e *ErrVersionMismatch) Error() string
type EventStoreLoader ¶
type EventStoreLoader interface {
Load(ctx context.Context, id event.LoopID, fromSeq uint64) iter.Seq2[event.Envelope, error]
}
EventStore is satisfied by any runtime EventStore implementation. Declared here to avoid importing the runtime package (which would create an import cycle).
Click to show internal directories.
Click to hide internal directories.