Versions in this module Expand all Collapse all v0 v0.2.0 Mar 21, 2018 v0.1.0 Mar 21, 2018 Changes in this version + const AggregateType + const CommandOther2Type + const CommandOtherType + const CommandType + const EventOtherType + const EventType + func CompareEvents(e1, e2 eh.Event) error + func ContextOne(ctx context.Context) (string, bool) + func WithContextOne(ctx context.Context, val string) context.Context + type Aggregate struct + Commands []eh.Command + Context context.Context + Err error + ID eh.UUID + func NewAggregate(id eh.UUID) *Aggregate + func (a *Aggregate) AggregateType() eh.AggregateType + func (a *Aggregate) EntityID() eh.UUID + func (a *Aggregate) HandleCommand(ctx context.Context, cmd eh.Command) error + type AggregateStore struct + Aggregates map[eh.UUID]eh.Aggregate + Context context.Context + Err error + func (m *AggregateStore) Load(ctx context.Context, aggregateType eh.AggregateType, id eh.UUID) (eh.Aggregate, error) + func (m *AggregateStore) Save(ctx context.Context, aggregate eh.Aggregate) error + type Command struct + Content string + ID eh.UUID + func (t Command) AggregateID() eh.UUID + func (t Command) AggregateType() eh.AggregateType + func (t Command) CommandType() eh.CommandType + type CommandHandler struct + Commands []eh.Command + Context context.Context + Err error + func (h *CommandHandler) HandleCommand(ctx context.Context, cmd eh.Command) error + type CommandOther struct + Content string + ID eh.UUID + func (t CommandOther) AggregateID() eh.UUID + func (t CommandOther) AggregateType() eh.AggregateType + func (t CommandOther) CommandType() eh.CommandType + type CommandOther2 struct + Content string + ID eh.UUID + func (t CommandOther2) AggregateID() eh.UUID + func (t CommandOther2) AggregateType() eh.AggregateType + func (t CommandOther2) CommandType() eh.CommandType + type EmptyAggregate struct + type EventBus struct + Context context.Context + Err error + Events []eh.Event + func (b *EventBus) AddHandler(m eh.EventMatcher, h eh.EventHandler) + func (b *EventBus) PublishEvent(ctx context.Context, event eh.Event) error + type EventData struct + Content string + type EventHandler struct + Context context.Context + Err error + Events []eh.Event + Recv chan eh.Event + Time time.Time + func NewEventHandler() *EventHandler + func (m *EventHandler) HandleEvent(ctx context.Context, event eh.Event) error + func (m *EventHandler) Reset() + func (m *EventHandler) WaitForEvent() error + type EventObserver struct + Context context.Context + Events []eh.Event + Recv chan eh.Event + func NewEventObserver() *EventObserver + func (m *EventObserver) Notify(ctx context.Context, event eh.Event) + func (m *EventObserver) WaitForEvent() error + type EventPublisher struct + Context context.Context + Err error + Events []eh.Event + Observers []eh.EventObserver + Recv chan eh.Event + func NewEventPublisher() *EventPublisher + func (m *EventPublisher) AddObserver(o eh.EventObserver) + func (m *EventPublisher) HandleEvent(ctx context.Context, event eh.Event) error + func (m *EventPublisher) WaitForEvent() error + type EventStore struct + Context context.Context + Err error + Events []eh.Event + Loaded eh.UUID + func (m *EventStore) Load(ctx context.Context, id eh.UUID) ([]eh.Event, error) + func (m *EventStore) Replace(ctx context.Context, event eh.Event) error + func (m *EventStore) Save(ctx context.Context, events []eh.Event, originalVersion int) error + type Model struct + Content string + CreatedAt time.Time + ID eh.UUID + Version int + func (m *Model) AggregateVersion() int + func (m *Model) EntityID() eh.UUID + type Repo struct + Entities []eh.Entity + Entity eh.Entity + FindAllCalled bool + FindCalled bool + LoadErr error + ParentRepo eh.ReadWriteRepo + RemoveCalled bool + SaveCalled bool + SaveErr error + func (r *Repo) Find(ctx context.Context, id eh.UUID) (eh.Entity, error) + func (r *Repo) FindAll(ctx context.Context) ([]eh.Entity, error) + func (r *Repo) Parent() eh.ReadRepo + func (r *Repo) Remove(ctx context.Context, id eh.UUID) error + func (r *Repo) Save(ctx context.Context, entity eh.Entity) error + type SimpleModel struct + Content string + ID eh.UUID + func (m *SimpleModel) EntityID() eh.UUID