Documentation ¶
Index ¶
- Variables
- type EventStore
- func (s *EventStore) Clear(ctx context.Context) error
- func (s *EventStore) Close()
- func (s *EventStore) FindAggregatesIds(ctx context.Context, filter interface{}) ([]string, error)
- func (s *EventStore) Load(ctx context.Context, id string) ([]eh.Event, error)
- func (s *EventStore) RenameEvent(ctx context.Context, from, to eh.EventType) error
- func (s *EventStore) Replace(ctx context.Context, event eh.Event) error
- func (s *EventStore) Save(ctx context.Context, events []eh.Event, originalVersion int) error
Constants ¶
This section is empty.
Variables ¶
var ErrCouldNotClearDB = errors.New("could not clear database")
ErrCouldNotClearDB is when the database could not be cleared.
var ErrCouldNotDialDB = errors.New("could not dial database")
ErrCouldNotDialDB is when the database could not be dialed.
var ErrCouldNotLoadAggregate = errors.New("could not load aggregate")
ErrCouldNotLoadAggregate is when an aggregate could not be loaded.
var ErrCouldNotMarshalEvent = errors.New("could not marshal event")
ErrCouldNotMarshalEvent is when an event could not be marshaled into BSON.
var ErrCouldNotSaveAggregate = errors.New("could not save aggregate")
ErrCouldNotSaveAggregate is when an aggregate could not be saved.
var ErrCouldNotUnmarshalEvent = errors.New("could not unmarshal event")
ErrCouldNotUnmarshalEvent is when an event could not be unmarshaled into a concrete type.
var ErrNoDBSession = errors.New("no database session")
ErrNoDBSession is when no database session is set.
Functions ¶
This section is empty.
Types ¶
type EventStore ¶
type EventStore struct {
// contains filtered or unexported fields
}
EventStore is a wrapper for the mongo-driver. Implements an EventStore for MongoDB
func NewEventStore ¶
func NewEventStore(connectionString, dbPrefix string) (*EventStore, error)
NewEventStore create a new Mongo Event Store
func (*EventStore) Clear ¶
func (s *EventStore) Clear(ctx context.Context) error
Clear clears the event storage.
func (*EventStore) Close ¶
func (s *EventStore) Close()
func (*EventStore) FindAggregatesIds ¶ added in v0.5.3
func (s *EventStore) FindAggregatesIds(ctx context.Context, filter interface{}) ([]string, error)
FindAggregatesIds implements the FindAggregatesIds method of the eventhorizon.EventStoreMaintainer interface
func (*EventStore) RenameEvent ¶
RenameEvent implements the RenameEvent method of the eventhorizon.EventStoreMaintainer interface.