Documentation
¶
Overview ¶
Package eventstoretest is the write-side contract suite that every eventstore backend (Pg and in-memory) must pass. A backend test calls
eventstoretest.Run(t, func(t *testing.T) eventstoretest.Backend { ... })
and the suite exercises it only through eventstore.Repository and eventstore.UnitOfWork.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Backend ¶
type Backend struct {
// Store opens a Store over the Backend's log. Stores opened from one
// Backend share their events, whatever their Codec.
Store func(cfg StoreConfig) eventstore.Store
UnitOfWork eventstore.UnitOfWork
// Guard and Numbering must join the UnitOfWork's transactions.
Guard Guard
Numbering Numbering
// Outer runs fn in a plain transaction of the UnitOfWork's backend
// (postgres.PgUnitOfWork or postgres.InMemoryUnitOfWork), which Command
// transactions in fn join.
Outer func(ctx context.Context, fn func(ctx context.Context) error) error
}
Backend is one empty event log under test.
type StoreConfig ¶
type StoreConfig struct {
Codec *eventstore.Codec
// Clock is passed to eventstore.WithClock.
Clock func() time.Time
}
StoreConfig configures one Store opened by a Backend.
Click to show internal directories.
Click to hide internal directories.