Documentation
¶
Index ¶
Constants ¶
View Source
const SourceDefault = "application"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseEvent ¶
type BaseEvent struct {
ID string `json:"id"`
EventTypeValue string `json:"eventType"`
OccurredAtValue time.Time `json:"occurredAt"`
AggregateTypeValue string `json:"aggregateType"`
AggregateIDValue string `json:"aggregateID"`
}
func NewBaseEvent ¶
func (BaseEvent) AggregateID ¶
func (BaseEvent) AggregateType ¶
func (BaseEvent) OccurredAt ¶
type DomainEvent ¶
type EventCollector ¶
type EventCollector struct {
// contains filtered or unexported fields
}
func NewEventCollector ¶
func NewEventCollector() *EventCollector
func (*EventCollector) AddEvent ¶
func (c *EventCollector) AddEvent(event DomainEvent)
func (*EventCollector) ClearEvents ¶
func (c *EventCollector) ClearEvents()
func (*EventCollector) Events ¶
func (c *EventCollector) Events() []DomainEvent
func (*EventCollector) HasEvents ¶
func (c *EventCollector) HasEvents() bool
type EventHandler ¶
type EventHandler func(ctx context.Context, event DomainEvent) error
type EventPublisher ¶
type EventPublisher = Publisher
type EventRaiser ¶
type EventRaiser interface {
Events() []DomainEvent
ClearEvents()
}
type EventStore ¶
type EventStore interface {
Save(ctx context.Context, events []DomainEvent) error
Load(ctx context.Context, aggregateType, aggregateID string) ([]DomainEvent, error)
LoadFrom(ctx context.Context, aggregateType, aggregateID string, fromVersion int64) ([]DomainEvent, error)
}
type EventSubscriber ¶
type NopEventPublisher ¶
type NopEventPublisher struct{}
func NewNopEventPublisher ¶
func NewNopEventPublisher() *NopEventPublisher
func (*NopEventPublisher) Publish ¶
func (p *NopEventPublisher) Publish(_ context.Context, _ DomainEvent) error
func (*NopEventPublisher) PublishAll ¶
func (p *NopEventPublisher) PublishAll(_ context.Context, _ []DomainEvent) error
type Publisher ¶
type Publisher interface {
Publish(ctx context.Context, event DomainEvent) error
PublishAll(ctx context.Context, events []DomainEvent) error
}
Click to show internal directories.
Click to hide internal directories.