Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidRepo is when a dispatcher is created with a nil repo. ErrInvalidRepo = errors.New("invalid repo") // ErrInvalidAggregate occurs when a loaded aggregate is not an aggregate. ErrInvalidAggregate = errors.New("invalid aggregate") )
Functions ¶
This section is empty.
Types ¶
type AggregateStore ¶
type AggregateStore struct {
// contains filtered or unexported fields
}
AggregateStore is an aggregate store that uses a read write repo for loading and saving aggregates.
func NewAggregateStore ¶
func NewAggregateStore(repo eh.ReadWriteRepo, eventHandler eh.EventHandler) (*AggregateStore, error)
NewAggregateStore creates an aggregate store with a read write repo and an event handler that can handle any resulting events (for example by publishing them on an event bus).
type SliceEventSource ¶ added in v0.15.6
SliceEventSource is an eh.EventSource using a slice to store events.
func (*SliceEventSource) AppendEvent ¶ added in v0.15.6
func (a *SliceEventSource) AppendEvent(e eh.Event)
AppendEvent appends an event to be handled after the aggregate has been successfully saved.
func (*SliceEventSource) ClearUncommittedEvents ¶ added in v0.15.6
func (a *SliceEventSource) ClearUncommittedEvents()
ClearUncommittedEvents implements the ClearUncommittedEvents method of the eh.EventSource interface.
func (*SliceEventSource) UncommittedEvents ¶ added in v0.15.6
func (a *SliceEventSource) UncommittedEvents() []eh.Event
UncommittedEvents implements the UncommittedEvents method of the eh.EventSource interface.
Click to show internal directories.
Click to hide internal directories.