Versions in this module Expand all Collapse all v2 v2.1.0 Sep 15, 2022 v2.0.0 Sep 14, 2021 Changes in this version + const IDKey + const TypeKey + const VersionKey + var ErrEmptyEventStream = errors.New("goengine: unsupported empty event stream") + var ErrInitiatorMustReturnRoot = errors.New(...) + var ErrInvalidChangePayload = errors.New("goengine: a changed event must have a payload that is not nil") + var ErrInvalidChangeVersion = errors.New("goengine: a changed event must have a version number greater than zero") + var ErrInvalidID = errors.New("goengine: an aggregate.ID must be a valid UUID") + var ErrMissingAggregateID = errors.New("goengine: no or empty aggregate ID was provided") + var ErrMissingChangeUUID = errors.New("goengine: no or empty message UUID was provided") + var ErrUnexpectedMessageType = errors.New("goengine: event store returned an unsupported message type") + var ErrUnsupportedAggregateType = errors.New("goengine: the given AggregateRoot is of a unsupported type") + func RecordChange(aggregateRoot Root, event interface{}) error + type BaseRoot struct + func (b *BaseRoot) AggregateVersion() uint + type Changed struct + func ReconstituteChange(aggregateID ID, uuid goengine.UUID, payload interface{}, ...) (*Changed, error) + func (a *Changed) AggregateID() ID + func (a *Changed) CreatedAt() time.Time + func (a *Changed) Metadata() metadata.Metadata + func (a *Changed) Payload() interface{} + func (a *Changed) UUID() goengine.UUID + func (a *Changed) Version() uint + func (a Changed) WithMetadata(key string, value interface{}) goengine.Message + type EventApplier interface + Apply func(event *Changed) + type ID string + func GenerateID() ID + func IDFromString(str string) (ID, error) + type Initiator func() Root + type Repository struct + func NewRepository(eventStore goengine.EventStore, streamName goengine.StreamName, ...) (*Repository, error) + func (r *Repository) GetAggregateRoot(ctx context.Context, aggregateID ID) (Root, error) + func (r *Repository) SaveAggregateRoot(ctx context.Context, aggregateRoot Root) error + type Root interface + AggregateID func() ID + type Type struct + func NewType(name string, initiator Initiator) (*Type, error) + func (t *Type) CreateInstance() Root + func (t *Type) IsImplementedBy(root interface{}) bool + func (t *Type) String() string Other modules containing this package github.com/hellofresh/goengine