Versions in this module Expand all Collapse all v0 v0.2.1 Feb 1, 2021 Changes in this version + var ErrCouldNotClearDB = errors.New("could not clear database") + var ErrCouldNotMarshalEvent = errors.New("could not marshal event") + var ErrCouldNotSaveAggregate = errors.New("could not save aggregate") + var ErrCouldNotUnmarshalEvent = errors.New("could not unmarshal event") + var ErrVersionConflict = errors.New("can not create/update aggregate") + var NewUUID = uuid.New + type AggregateEvent struct + AggregateID uuid.UUID + AggregateType eh.AggregateType + Context map[string]interface{} + EventID uuid.UUID + EventType eh.EventType + MetaData map[string]interface{} + Namespace string + RawEventData json.RawMessage + RawMetaData json.RawMessage + Timestamp time.Time + Version int + func (a *AggregateEvent) UnmarshalBinary(data []byte) error + func (a AggregateEvent) MarshalBinary() (data []byte, err error) + type AggregateRecord struct + AggregateID uuid.UUID + Namespace string + Version int + type Encoder interface + Marshal func(eh.EventData) ([]byte, error) + String func() string + Unmarshal func(eh.EventType, []byte) (eh.EventData, error) + type EventStore struct + func NewEventStore(db redis.UniversalClient) (*EventStore, error) + func (s *EventStore) Clear(ctx context.Context) error + func (s *EventStore) Close() error + func (s *EventStore) Load(ctx context.Context, id uuid.UUID) ([]eh.Event, error) + func (s *EventStore) Save(ctx context.Context, events []eh.Event, originalVersion int) error