Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Advanced ¶ added in v0.8.0
Advanced implements an advanced aggregate root.
func NewAdvanced ¶ added in v0.8.0
func NewAdvanced(pureAgg domain.Aggregate, commandHandler domain.CommandHandler, eventApplier domain.EventApplier) *Advanced
NewAdvanced creates a new instance of Advanced.
func (*Advanced) Apply ¶ added in v0.8.0
func (b *Advanced) Apply(e ...domain.DomainEvent) error
Apply implements domain.EventApplier interface.
type CommandHandler ¶ added in v0.8.0
type CommandHandler struct {
// contains filtered or unexported fields
}
CommandHandler registers and handles commands.
func NewCommandHandler ¶ added in v0.8.0
func NewCommandHandler() *CommandHandler
NewCommandHandler creates a new instance of CommandHandler.
func (*CommandHandler) Handle ¶ added in v0.8.0
func (h *CommandHandler) Handle(c domain.Command) ([]domain.DomainEvent, error)
Handle implements domain.CommandHandler interface.
func (*CommandHandler) RegisterHandler ¶ added in v0.8.0
func (h *CommandHandler) RegisterHandler(method string, handler domain.CommandHandlerFunc)
RegisterHandler registers a command handler for the given method.
func (*CommandHandler) RegisterHandlers ¶ added in v0.8.0
func (h *CommandHandler) RegisterHandlers(aggregate domain.Aggregate)
RegisterHandlers registers all the command handlers found in the aggregate.
type EventApplier ¶ added in v0.8.0
type EventApplier struct {
// contains filtered or unexported fields
}
EventApplier applies events for the registered appliers.
func NewEventApplier ¶ added in v0.8.0
func NewEventApplier() *EventApplier
NewEventApplier creates a new instance of EventApplier.
func (*EventApplier) Apply ¶ added in v0.8.0
func (a *EventApplier) Apply(events ...domain.DomainEvent) error
Apply implements domain.EventApplier interface.
func (*EventApplier) RegisterApplier ¶ added in v0.8.0
func (a *EventApplier) RegisterApplier(method string, applier domain.EventApplierFunc)
RegisterApplier registers an event applier for the given method.
func (*EventApplier) RegisterAppliers ¶ added in v0.8.0
func (a *EventApplier) RegisterAppliers(aggregate domain.Aggregate)
RegisterAppliers registers all the event appliers found in the aggregate.
type Factory ¶ added in v0.5.0
type Factory struct {
// contains filtered or unexported fields
}
Factory handles aggregate creation.
func NewFactory ¶ added in v0.5.0
func NewFactory() *Factory
func (*Factory) CreateAggregate ¶ added in v0.5.0
func (f *Factory) CreateAggregate(aggregateType string, ID domain.Identifier) (domain.AdvancedAggregate, error)
CreateAggregate creates an aggregate of a given type.
func (*Factory) RegisterAggregate ¶ added in v0.5.0
RegisterAggregate registers an aggregate factory method.