Documentation
¶
Overview ¶
Package memory provides an in-memory EventStore implementation. It is intended for tests and development only — data is lost on process restart. It fully satisfies the storetest contract suite.
Index ¶
- type ArtifactStore
- type Store
- func (s *Store) Append(_ context.Context, id event.LoopID, expectedLastSeq uint64, ...) error
- func (s *Store) LatestSnapshot(_ context.Context, id event.LoopID) (event.Snapshot, bool, error)
- func (s *Store) List(_ context.Context, f runtime.ListFilter) ([]runtime.LoopMeta, error)
- func (s *Store) Load(_ context.Context, id event.LoopID, fromSeq uint64) iter.Seq2[event.Envelope, error]
- func (s *Store) SaveSnapshot(_ context.Context, snap event.Snapshot) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArtifactStore ¶
type ArtifactStore struct {
// contains filtered or unexported fields
}
ArtifactStore is an in-memory implementation of runtime.ArtifactStore. Keys are formatted as "<loopID>/<seq>/<counter>" to guarantee uniqueness. This implementation is goroutine-safe.
func NewArtifactStore ¶
func NewArtifactStore() *ArtifactStore
NewArtifactStore creates an empty in-memory ArtifactStore.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is the in-memory EventStore. Thread-safe.
func (*Store) Append ¶
func (s *Store) Append(_ context.Context, id event.LoopID, expectedLastSeq uint64, evs []event.Envelope) error
Append appends evs to the event log for loop id. expectedLastSeq must match the actual last seq (0 if no events exist yet). Returns runtime.ErrConflict on mismatch.
func (*Store) LatestSnapshot ¶
LatestSnapshot returns the snapshot with the highest Seq for the given loop.