Documentation ¶
Index ¶
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 ErrInvalidEvent = errors.New("invalid event")
ErrInvalidEvent is when an event does not implement the Event interface.
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 implements an EventStore for MongoDB.
func NewEventStore ¶
func NewEventStore(url, database string) (*EventStore, error)
NewEventStore creates a new EventStore.
func NewEventStoreWithSession ¶
func NewEventStoreWithSession(session *mgo.Session, database string) (*EventStore, error)
NewEventStoreWithSession creates a new EventStore with a session.
func (*EventStore) Load ¶
func (s *EventStore) Load(aggregateType eh.AggregateType, id eh.UUID) ([]eh.EventRecord, error)
Load loads all events for the aggregate id from the database. Returns ErrNoEventsFound if no events can be found.