Documentation ¶
Index ¶
- func IsDup(err error) bool
- type EventStore
- func (s *EventStore) Clear(ctx context.Context) error
- func (s *EventStore) Close(ctx context.Context) error
- func (s *EventStore) DBName() string
- func (s *EventStore) Insert(ctx context.Context, task maintenance.Task) error
- func (s *EventStore) LoadFromSnapshot(ctx context.Context, queries []eventstore.SnapshotQuery, ...) error
- func (s *EventStore) LoadFromVersion(ctx context.Context, queries []eventstore.VersionQuery, eh event.Handler) error
- func (s *EventStore) LoadSnapshotQueries(ctx context.Context, queries []eventstore.SnapshotQuery, qh *loader) error
- func (s *EventStore) LoadUpToVersion(ctx context.Context, queries []eventstore.VersionQuery, eh event.Handler) error
- func (s *EventStore) Query(ctx context.Context, limit int, taskHandler maintenance.TaskHandler) error
- func (s *EventStore) Remove(ctx context.Context, task maintenance.Task) error
- func (s *EventStore) RemoveUpToVersion(ctx context.Context, queries []eventstore.VersionQuery) error
- func (s *EventStore) Save(ctx context.Context, groupId, aggregateId string, events []event.Event) (concurrencyException bool, err error)
- func (s *EventStore) SaveSnapshot(ctx context.Context, groupId string, aggregateId string, ev event.Event) (concurrencyException bool, err error)
- func (s *EventStore) SaveSnapshotQuery(ctx context.Context, groupID, aggregateID string, version uint64) (concurrencyException bool, err error)
- type LogDebugfFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type EventStore ¶
type EventStore struct { LogDebugfFunc LogDebugfFunc // contains filtered or unexported fields }
EventStore implements an EventStore for MongoDB.
func NewEventStore ¶
func NewEventStore(ctx context.Context, host, dbPrefix string, colPrefix string, batchSize int, goroutinePoolGo eventstore.GoroutinePoolGoFunc, eventMarshaler event.MarshalerFunc, eventUnmarshaler event.UnmarshalerFunc, LogDebugfFunc LogDebugfFunc, opts ...*options.ClientOptions) (*EventStore, error)
NewEventStore creates a new EventStore.
func NewEventStoreWithClient ¶
func NewEventStoreWithClient(ctx context.Context, client *mongo.Client, dbPrefix string, colPrefix string, batchSize int, goroutinePoolGo eventstore.GoroutinePoolGoFunc, eventMarshaler event.MarshalerFunc, eventUnmarshaler event.UnmarshalerFunc, LogDebugfFunc LogDebugfFunc) (*EventStore, error)
NewEventStoreWithClient creates a new EventStore with a session.
func (*EventStore) Clear ¶
func (s *EventStore) Clear(ctx context.Context) error
Clear clears the event storage.
func (*EventStore) Close ¶
func (s *EventStore) Close(ctx context.Context) error
Close closes the database session.
func (*EventStore) Insert ¶
func (s *EventStore) Insert(ctx context.Context, task maintenance.Task) error
Insert stores (or updates) the information about the latest snapshot version per aggregate into the DB
func (*EventStore) LoadFromSnapshot ¶
func (s *EventStore) LoadFromSnapshot(ctx context.Context, queries []eventstore.SnapshotQuery, eventHandler event.Handler) error
Load loads events from begining.
func (*EventStore) LoadFromVersion ¶
func (s *EventStore) LoadFromVersion(ctx context.Context, queries []eventstore.VersionQuery, eh event.Handler) error
LoadFromVersion loads aggragates events from version.
func (*EventStore) LoadSnapshotQueries ¶
func (s *EventStore) LoadSnapshotQueries(ctx context.Context, queries []eventstore.SnapshotQuery, qh *loader) error
func (*EventStore) LoadUpToVersion ¶
func (s *EventStore) LoadUpToVersion(ctx context.Context, queries []eventstore.VersionQuery, eh event.Handler) error
LoadUpToVersion loads aggragates events up to a specific version.
func (*EventStore) Query ¶
func (s *EventStore) Query(ctx context.Context, limit int, taskHandler maintenance.TaskHandler) error
Query retrieves the latest snapshot version per aggregate for thw number of aggregates specified by 'limit'
func (*EventStore) Remove ¶
func (s *EventStore) Remove(ctx context.Context, task maintenance.Task) error
Remove deletes (the latest snapshot version) database record for a given aggregate ID
func (*EventStore) RemoveUpToVersion ¶
func (s *EventStore) RemoveUpToVersion(ctx context.Context, queries []eventstore.VersionQuery) error
RemoveUpToVersion deletes the aggragates events up to a specific version.
func (*EventStore) Save ¶
func (s *EventStore) Save(ctx context.Context, groupId, aggregateId string, events []event.Event) (concurrencyException bool, err error)
Save save events to path.
func (*EventStore) SaveSnapshot ¶
func (*EventStore) SaveSnapshotQuery ¶
func (s *EventStore) SaveSnapshotQuery(ctx context.Context, groupID, aggregateID string, version uint64) (concurrencyException bool, err error)
SaveSnapshotQuery upserts the snapshot record
type LogDebugfFunc ¶
type LogDebugfFunc func(fmt string, args ...interface{})