Versions in this module Expand all Collapse all v0 v0.6.1 Apr 29, 2026 Changes in this version + const SourceDefault + type BaseEvent struct + AggregateIDValue string + AggregateTypeValue string + EventTypeValue string + ID string + OccurredAtValue time.Time + func NewBaseEvent(eventType, aggregateType, aggregateID string) BaseEvent + func (e BaseEvent) AggregateID() string + func (e BaseEvent) AggregateType() string + func (e BaseEvent) EventID() string + func (e BaseEvent) EventType() string + func (e BaseEvent) OccurredAt() time.Time + type DomainEvent interface + AggregateID func() string + AggregateType func() string + EventID func() string + EventType func() string + OccurredAt func() time.Time + type Event struct + Data T + func New[T any](eventType, aggregateType, aggregateID string, data T) Event[T] + func (e Event[T]) Payload() T + type EventCollector struct + func NewEventCollector() *EventCollector + func (c *EventCollector) AddEvent(event DomainEvent) + func (c *EventCollector) ClearEvents() + func (c *EventCollector) Events() []DomainEvent + func (c *EventCollector) HasEvents() bool + type EventHandler func(ctx context.Context, event DomainEvent) error + type EventPublisher = Publisher + type EventRaiser interface + ClearEvents func() + Events func() []DomainEvent + type EventStore interface + Load func(ctx context.Context, aggregateType, aggregateID string) ([]DomainEvent, error) + LoadFrom func(ctx context.Context, aggregateType, aggregateID string, fromVersion int64) ([]DomainEvent, error) + Save func(ctx context.Context, events []DomainEvent) error + type EventSubscriber interface + Start func(ctx context.Context) error + Stop func() error + Subscribe func(eventType string, handler EventHandler) error + type NopEventPublisher struct + func NewNopEventPublisher() *NopEventPublisher + func (p *NopEventPublisher) Publish(_ context.Context, _ DomainEvent) error + func (p *NopEventPublisher) PublishAll(_ context.Context, _ []DomainEvent) error + type Publisher interface + Publish func(ctx context.Context, event DomainEvent) error + PublishAll func(ctx context.Context, events []DomainEvent) error + type Stager interface + Stage func(ctx context.Context, events ...DomainEvent) error