Versions in this module Expand all Collapse all v0 v0.2.1 Sep 22, 2023 Changes in this version + var ErrRootNotFound = fmt.Errorf("aggregate: root not found") + func RecordThat(root Root[I], event ...event.Envelope) error + func RehydrateFromEvents(root Root[I], eventStream event.StreamRead) error + func RehydrateFromState(v version.Version, dst Dst, deserializer serde.Deserializer[Src, Dst]) (Src, error) + type Aggregate interface + Apply func(event.Event) error + type BaseRoot struct + func (br *BaseRoot) FlushRecordedEvents() []event.Envelope + func (br BaseRoot) Version() version.Version + type EventSourcedRepository struct + func NewEventSourcedRepository(eventStore event.Store, typ Type[I, T]) EventSourcedRepository[I, T] + func (repo EventSourcedRepository[I, T]) Get(ctx context.Context, id I) (T, error) + func (repo EventSourcedRepository[I, T]) Save(ctx context.Context, root T) error + type Factory func() T + type FusedRepository struct + type Getter interface + Get func(ctx context.Context, id I) (T, error) + type ID interface + type Internal interface + FlushRecordedEvents func() []event.Envelope + type Repository interface + type Root interface + AggregateID func() I + Version func() version.Version + type Saver interface + Save func(ctx context.Context, root T) error + type Type struct + Factory func() T + Name string