Documentation
¶
Overview ¶
Package conformance provides an end-to-end conformance suite that tests the full event sourcing pipeline:
Command → CommandBus → Decider → Store → Subscription → Projection → Query
This catches bugs that live at the seams between components — a store can pass its own conformance suite but break when the subscription's global sequence doesn't align, or when snapshot versions cause off-by-one errors.
Usage:
func TestE2E_MemoryStore(t *testing.T) {
conformance.RunSuite(t, conformance.MemoryFactory())
}
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AccountCommand ¶
type AccountCommand interface {
// contains filtered or unexported methods
}
type AccountEvent ¶
type AccountEvent interface {
// contains filtered or unexported methods
}
type AccountOpened ¶
type AccountOpened struct{ Balance int }
type AccountState ¶
type BalanceProjection ¶
type BalanceProjection struct {
// contains filtered or unexported fields
}
func NewBalanceProjection ¶
func NewBalanceProjection() *BalanceProjection
func (*BalanceProjection) EventCount ¶
func (p *BalanceProjection) EventCount() int64
func (*BalanceProjection) Handle ¶
func (p *BalanceProjection) Handle(_ context.Context, evt subscription.GlobalEvent[AccountEvent]) error
type Factory ¶
Factory creates fresh infrastructure for each test.
func MemoryFactory ¶
func MemoryFactory() Factory
type Infra ¶
type Infra struct {
Store eskit.EventStore[AccountEvent]
SnapshotStore eskit.SnapshotStore[AccountState]
GlobalReader subscription.GlobalReader[AccountEvent]
Notifier *subscription.ChannelNotifier
}
Infra holds the wired-up infrastructure for a single test run.
type NotifyingStore ¶
type NotifyingStore[E any] struct { eskit.EventStore[E] // contains filtered or unexported fields }
NotifyingStore wraps an EventStore to signal a notifier on append.
func NewNotifyingStore ¶
func NewNotifyingStore[E any]( store eskit.EventStore[E], notifier *subscription.ChannelNotifier, seqFn func(ctx context.Context) (uint64, error), ) *NotifyingStore[E]
type OpenAccount ¶
func (OpenAccount) StreamID ¶
func (c OpenAccount) StreamID() string
Click to show internal directories.
Click to hide internal directories.