Versions in this module Expand all Collapse all v0 v0.1.4 Nov 16, 2023 v0.1.3 Nov 16, 2023 Changes in this version + func LoadEvent(v interface{}, event ddd.AggregateEvent) error + func LoadSnapshot(v interface{}, snapshot Snapshot, version int) error + func NewAggregate(id, name string) *aggregate + func NewAggregateRepository[T EventSourcedAggregate](aggregateName string, registry registry.Registry, store AggregateStore) aggregateRepository[T] + func SetVersion(version int) registry.BuildOption + type Aggregate interface + type AggregateRepository interface + Load func(context.Context, string) (T, error) + Save func(context.Context, T) error + type AggregateStore interface + Load func(context.Context, EventSourcedAggregate) error + Save func(context.Context, EventSourcedAggregate) error + func AggregateStoreWithMiddleware(store AggregateStore, middleware ...AggregateStoreMiddleware) AggregateStore + type AggregateStoreMiddleware func(AggregateStore) AggregateStore + func NewEventPublisher(publisher ddd.EventPublisher[ddd.AggregateEvent]) AggregateStoreMiddleware + type EventApplier interface + ApplyEvent func(event ddd.Event) error + type EventCommitter interface + CommitEvents func() + type EventPublisher struct + func (p EventPublisher) Save(ctx context.Context, aggregate EventSourcedAggregate) error + type EventSourcedAggregate interface + AggregateName func() string + type MockAggregate struct + func NewMockAggregate(t interface{ ... }) *MockAggregate + func (_m *MockAggregate) AddEvent(_a0 string, _a1 ddd.EventPayload, _a2 ...ddd.EventOption) + func (_m *MockAggregate) AggregateName() string + func (_m *MockAggregate) ClearEvents() + func (_m *MockAggregate) CommitEvents() + func (_m *MockAggregate) Events() []ddd.AggregateEvent + func (_m *MockAggregate) ID() string + func (_m *MockAggregate) PendingVersion() int + func (_m *MockAggregate) SetID(_a0 string) + func (_m *MockAggregate) SetName(_a0 string) + func (_m *MockAggregate) SetVersion(_a0 int) + func (_m *MockAggregate) Version() int + type MockAggregateRepository struct + func NewMockAggregateRepository[T EventSourcedAggregate](t interface{ ... }) *MockAggregateRepository[T] + func (_m *MockAggregateRepository[T]) Load(_a0 context.Context, _a1 string) (T, error) + func (_m *MockAggregateRepository[T]) Save(_a0 context.Context, _a1 T) error + type MockAggregateStore struct + func NewMockAggregateStore(t interface{ ... }) *MockAggregateStore + func (_m *MockAggregateStore) Load(_a0 context.Context, _a1 EventSourcedAggregate) error + func (_m *MockAggregateStore) Save(_a0 context.Context, _a1 EventSourcedAggregate) error + type MockEventSourcedAggregate struct + func NewMockEventSourcedAggregate(t interface{ ... }) *MockEventSourcedAggregate + func (_m *MockEventSourcedAggregate) AddEvent(_a0 string, _a1 ddd.EventPayload, _a2 ...ddd.EventOption) + func (_m *MockEventSourcedAggregate) AggregateName() string + func (_m *MockEventSourcedAggregate) ApplyEvent(event ddd.Event) error + func (_m *MockEventSourcedAggregate) ClearEvents() + func (_m *MockEventSourcedAggregate) CommitEvents() + func (_m *MockEventSourcedAggregate) Events() []ddd.AggregateEvent + func (_m *MockEventSourcedAggregate) ID() string + func (_m *MockEventSourcedAggregate) PendingVersion() int + func (_m *MockEventSourcedAggregate) Version() int + type Snapshot interface + SnapshotName func() string + type SnapshotApplier interface + ApplySnapshot func(Snapshot) error + type Snapshotter interface + ToSnapshot func() Snapshot + type VersionSetter interface + SetVersion func(int) + type Versioner interface + PendingVersion func() int + Version func() int