Versions in this module Expand all Collapse all v5 v5.0.1 Jul 28, 2026 Changes in this version + var ErrAlreadyApplied = errors.New("domain: command already applied") + var ErrCommandCancelled = errors.New("domain: command was cancelled") + type BulkCommand struct + CheckpointEvery int + ID CommandID + Total int + YieldEvery int + type BulkResult struct + Completed bool + MaxReplayWindow int + NextIndex int + Outcome Outcome + Processed int + ResumedFrom int + Total int + type Checkpoint struct + CommandID CommandID + Exact bool + NextIndex int + Total int + type CheckpointStore interface + Clear func(parseCommandID CommandID) error + Load func(parseCommandID CommandID) (Checkpoint, bool, error) + Save func(parseCheckpoint Checkpoint) error + type CommandID string + type MemoryCheckpointStore struct + func NewMemoryCheckpointStore() *MemoryCheckpointStore + func (parseStore *MemoryCheckpointStore) Clear(parseCommandID CommandID) error + func (parseStore *MemoryCheckpointStore) Load(parseCommandID CommandID) (Checkpoint, bool, error) + func (parseStore *MemoryCheckpointStore) Save(parseCheckpoint Checkpoint) error + func (parseStore *MemoryCheckpointStore) Snapshot() map[CommandID]Checkpoint + type MemoryTransactionalCheckpointStore struct + func NewMemoryTransactionalCheckpointStore() *MemoryTransactionalCheckpointStore + func (parseStore *MemoryTransactionalCheckpointStore) AppliedCount() int + func (parseStore *MemoryTransactionalCheckpointStore) ApplyExactlyOnce(parseCommandID CommandID, parseEffect func() error) error + type Outcome uint8 + const OutcomeApplied + const OutcomeCancelled + const OutcomeFailed + const OutcomeReplayed + func (parseOutcome Outcome) Applied() bool + func (parseOutcome Outcome) String() string + type Runtime struct + func NewRuntime(parseCheckpoints CheckpointStore) *Runtime + func RestoreRuntime(parseCheckpoints CheckpointStore, parseState RuntimeState) (*Runtime, error) + func (parseRuntime *Runtime) Cancel(parseCommandID CommandID) error + func (parseRuntime *Runtime) ExactlyOnce() bool + func (parseRuntime *Runtime) Execute(parseCommandID CommandID, parseEffect func() error) (Outcome, error) + func (parseRuntime *Runtime) ExecuteBulk(parseCommand BulkCommand, parseStep func(parseIndex int) error) (BulkResult, error) + func (parseRuntime *Runtime) ExportState() RuntimeState + func (parseRuntime *Runtime) Forget(parseCommandID CommandID) error + func (parseRuntime *Runtime) IsCancelled(parseCommandID CommandID) bool + func (parseRuntime *Runtime) SetYield(parseYield func()) + func (parseRuntime *Runtime) TrackedCommands() int + type RuntimeState struct + Applied []CommandID + Cancelled []CommandID + type TransactionalCheckpointStore interface + ApplyExactlyOnce func(parseCommandID CommandID, parseEffect func() error) error