Documentation ¶
Index ¶
- type Config
- type EventStore
- func (s *EventStore) AddCloseFunc(f func())
- func (s *EventStore) Clear(ctx context.Context) error
- func (s *EventStore) ClearTable(ctx context.Context) error
- func (s *EventStore) Close(_ context.Context) error
- func (s *EventStore) Delete(ctx context.Context, queries []eventstore.DeleteQuery) error
- func (s *EventStore) GetEvents(ctx context.Context, queries []eventstore.GetEventsQuery, timestamp int64, ...) error
- func (s *EventStore) GetLatestDeviceETags(ctx context.Context, deviceID string, limit uint32) ([][]byte, error)
- func (s *EventStore) LoadDeviceMetadataByServiceIDs(ctx context.Context, serviceIDs []string, limit int64) ([]eventstore.DeviceDocumentMetadata, error)
- func (s *EventStore) LoadFromSnapshot(ctx context.Context, queries []eventstore.SnapshotQuery, ...) error
- func (s *EventStore) LoadFromVersion(ctx context.Context, queries []eventstore.VersionQuery, eh eventstore.Handler) error
- func (s *EventStore) LoadUpToVersion(_ context.Context, _ []eventstore.VersionQuery, _ eventstore.Handler) error
- func (s *EventStore) Query(_ context.Context, _ int, _ maintenance.TaskHandler) error
- func (s *EventStore) Remove(_ context.Context, _ maintenance.Task) error
- func (s *EventStore) RemoveUpToVersion(_ context.Context, _ []eventstore.VersionQuery) error
- func (s *EventStore) Save(ctx context.Context, events ...eventstore.Event) (eventstore.SaveStatus, error)
- func (s *EventStore) Table() string
- type MarshalerFunc
- type MarshalerOpt
- type Option
- type UnmarshalerFunc
- type UnmarshalerOpt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Embedded cqldb.Config `yaml:",inline" json:",inline"` Table string `yaml:"table" json:"table"` // contains filtered or unexported fields }
Config provides Mongo DB configuration options
type EventStore ¶
type EventStore struct {
// contains filtered or unexported fields
}
EventStore implements an EventStore for cqldb.
func (*EventStore) AddCloseFunc ¶
func (s *EventStore) AddCloseFunc(f func())
func (*EventStore) Clear ¶
func (s *EventStore) Clear(ctx context.Context) error
Clear clears the event storage.
func (*EventStore) ClearTable ¶
func (s *EventStore) ClearTable(ctx context.Context) error
Clear documents in collections, but don't drop the database or the collections
func (*EventStore) Close ¶
func (s *EventStore) Close(_ context.Context) error
Close closes the database session.
func (*EventStore) Delete ¶
func (s *EventStore) Delete(ctx context.Context, queries []eventstore.DeleteQuery) error
Delete documents with given group ids
func (*EventStore) GetEvents ¶
func (s *EventStore) GetEvents(ctx context.Context, queries []eventstore.GetEventsQuery, timestamp int64, eventHandler eventstore.Handler) error
Get events from the eventstore.
func (*EventStore) GetLatestDeviceETags ¶
func (s *EventStore) GetLatestDeviceETags(ctx context.Context, deviceID string, limit uint32) ([][]byte, error)
Get latest ETags for device resources from event store for batch observing
func (*EventStore) LoadDeviceMetadataByServiceIDs ¶
func (s *EventStore) LoadDeviceMetadataByServiceIDs(ctx context.Context, serviceIDs []string, limit int64) ([]eventstore.DeviceDocumentMetadata, error)
func (*EventStore) LoadFromSnapshot ¶
func (s *EventStore) LoadFromSnapshot(ctx context.Context, queries []eventstore.SnapshotQuery, eventHandler eventstore.Handler) error
LoadFromSnapshot loads events from the last snapshot eventstore.
func (*EventStore) LoadFromVersion ¶
func (s *EventStore) LoadFromVersion(ctx context.Context, queries []eventstore.VersionQuery, eh eventstore.Handler) error
LoadFromVersion loads aggregates events from version.
func (*EventStore) LoadUpToVersion ¶
func (s *EventStore) LoadUpToVersion(_ context.Context, _ []eventstore.VersionQuery, _ eventstore.Handler) error
LoadUpToVersion loads aggregates events up to a specific version. It loads events from the last snapshot. Only last snapshots
func (*EventStore) Query ¶
func (s *EventStore) Query(_ context.Context, _ int, _ 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(_ context.Context, _ maintenance.Task) error
Remove deletes (the latest snapshot version) database record for a given aggregate ID
func (*EventStore) RemoveUpToVersion ¶
func (s *EventStore) RemoveUpToVersion(_ context.Context, _ []eventstore.VersionQuery) error
RemoveUpToVersion deletes the aggregated events up to a specific version.
func (*EventStore) Save ¶
func (s *EventStore) Save(ctx context.Context, events ...eventstore.Event) (eventstore.SaveStatus, error)
Save save events to eventstore. AggregateID, GroupID and EventType are required. All events within one Save operation shall have the same AggregateID and GroupID. Versions shall be unique and ascend continually. Only first event can be a snapshot.
func (*EventStore) Table ¶
func (s *EventStore) Table() string
type MarshalerFunc ¶
MarshalerFunc marshal struct to bytes.
type MarshalerOpt ¶
type MarshalerOpt struct {
// contains filtered or unexported fields
}
func WithMarshaler ¶
func WithMarshaler(f MarshalerFunc) MarshalerOpt
WithMarshaler provides the possibility to set an marshaling function for the config
type Option ¶
type Option interface {
// contains filtered or unexported methods
}
Option provides the means to use function call chaining
type UnmarshalerFunc ¶
UnmarshalerFunc unmarshal bytes to pointer of struct.
type UnmarshalerOpt ¶
type UnmarshalerOpt struct {
// contains filtered or unexported fields
}
func WithUnmarshaler ¶
func WithUnmarshaler(f UnmarshalerFunc) UnmarshalerOpt
WithUnmarshaler provides the possibility to set an unmarshaling function for the config