Documentation
¶
Index ¶
- Variables
- func AcceptanceTest(t *testing.T, ctx context.Context, store eventstore.EventStore)
- func GetEventsTest(t *testing.T, ctx context.Context, store eventstore.EventStore)
- func MakeAuditContext(userID string, correlationID string) *commands.AuditContext
- func MakeDeviceMetadata(deviceID string, deviceMetadataUpdated *events.DeviceMetadataUpdated, ...) eventstore.EventUnmarshaler
- func MakeDeviceMetadataUpdatePending(deviceID string, ...) eventstore.EventUnmarshaler
- func MakeDeviceMetadataUpdated(deviceID string, status *commands.ConnectionStatus, ...) eventstore.EventUnmarshaler
- func MakeResourceChangedEvent(resourceID *commands.ResourceId, content *commands.Content, ...) eventstore.EventUnmarshaler
- func MakeResourceCreatePending(resourceID *commands.ResourceId, content *commands.Content, ...) eventstore.EventUnmarshaler
- func MakeResourceCreated(resourceID *commands.ResourceId, status commands.Status, ...) eventstore.EventUnmarshaler
- func MakeResourceDeletePending(resourceID *commands.ResourceId, eventMetadata *events.EventMetadata, ...) eventstore.EventUnmarshaler
- func MakeResourceDeleted(resourceID *commands.ResourceId, status commands.Status, ...) eventstore.EventUnmarshaler
- func MakeResourceLinksPublishedEvent(resources []*commands.Resource, deviceID string, ...) eventstore.EventUnmarshaler
- func MakeResourceLinksSnapshotTaken(resources map[string]*commands.Resource, deviceID string, ...) eventstore.EventUnmarshaler
- func MakeResourceLinksUnpublishedEvent(hrefs []string, deviceID string, eventMetadata *events.EventMetadata) eventstore.EventUnmarshaler
- func MakeResourceRetrievePending(resourceID *commands.ResourceId, resourceInterface string, ...) eventstore.EventUnmarshaler
- func MakeResourceRetrieved(resourceID *commands.ResourceId, status commands.Status, ...) eventstore.EventUnmarshaler
- func MakeResourceStateSnapshotTaken(resourceID *commands.ResourceId, latestResourceChange *events.ResourceChanged, ...) eventstore.EventUnmarshaler
- func MakeResourceUpdatePending(resourceID *commands.ResourceId, content *commands.Content, ...) eventstore.EventUnmarshaler
- func MakeResourceUpdated(resourceID *commands.ResourceId, status commands.Status, ...) eventstore.EventUnmarshaler
- type MockEvent
- type MockEventHandler
- func (eh *MockEventHandler) Contains(event eventstore.Event) bool
- func (eh *MockEventHandler) ContainsGroupID(groupID string) bool
- func (eh *MockEventHandler) Count() int
- func (eh *MockEventHandler) Equals(events []eventstore.Event) bool
- func (eh *MockEventHandler) Handle(ctx context.Context, iter eventstore.Iter) error
- func (eh *MockEventHandler) SetElement(groupID, aggregateID string, e MockEvent)
- func (eh *MockEventHandler) SnapshotEventType() string
- type MockEventStore
- func (s *MockEventStore) Append(groupID, aggregateID string, ev eventstore.EventUnmarshaler)
- func (s *MockEventStore) Delete(ctx context.Context, queries []eventstore.DeleteQuery) error
- func (s *MockEventStore) GetEvents(ctx context.Context, queries []eventstore.GetEventsQuery, timestamp int64, ...) error
- func (s *MockEventStore) LoadFromSnapshot(ctx context.Context, queries []eventstore.SnapshotQuery, ...) error
- func (s *MockEventStore) LoadFromVersion(ctx context.Context, queries []eventstore.VersionQuery, ...) error
- func (s *MockEventStore) LoadUpToVersion(ctx context.Context, queries []eventstore.VersionQuery, ...) error
- func (s *MockEventStore) RemoveUpToVersion(ctx context.Context, queries []eventstore.VersionQuery) error
- func (s *MockEventStore) Save(ctx context.Context, events ...eventstore.Event) (eventstore.SaveStatus, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var StaticAuditContext = &commands.AuditContext{
UserId: "userId",
}
Functions ¶
func AcceptanceTest ¶
func AcceptanceTest(t *testing.T, ctx context.Context, store eventstore.EventStore)
func GetEventsTest ¶
func GetEventsTest(t *testing.T, ctx context.Context, store eventstore.EventStore)
func MakeAuditContext ¶
func MakeAuditContext(userID string, correlationID string) *commands.AuditContext
func MakeDeviceMetadata ¶
func MakeDeviceMetadata(deviceID string, deviceMetadataUpdated *events.DeviceMetadataUpdated, eventMetadata *events.EventMetadata) eventstore.EventUnmarshaler
func MakeDeviceMetadataUpdatePending ¶
func MakeDeviceMetadataUpdatePending(deviceID string, shadowSync *events.DeviceMetadataUpdatePending_ShadowSynchronization, eventMetadata *events.EventMetadata, auditContext *commands.AuditContext, validUntil time.Time) eventstore.EventUnmarshaler
func MakeDeviceMetadataUpdated ¶
func MakeDeviceMetadataUpdated(deviceID string, status *commands.ConnectionStatus, shadowSynchronization commands.ShadowSynchronization, eventMetadata *events.EventMetadata, auditContext *commands.AuditContext, canceled bool) eventstore.EventUnmarshaler
func MakeResourceChangedEvent ¶
func MakeResourceChangedEvent(resourceID *commands.ResourceId, content *commands.Content, eventMetadata *events.EventMetadata, auditContext *commands.AuditContext) eventstore.EventUnmarshaler
func MakeResourceCreatePending ¶
func MakeResourceCreatePending(resourceID *commands.ResourceId, content *commands.Content, eventMetadata *events.EventMetadata, auditContext *commands.AuditContext, validUntil time.Time) eventstore.EventUnmarshaler
func MakeResourceCreated ¶
func MakeResourceCreated(resourceID *commands.ResourceId, status commands.Status, content *commands.Content, eventMetadata *events.EventMetadata, auditContext *commands.AuditContext) eventstore.EventUnmarshaler
func MakeResourceDeletePending ¶
func MakeResourceDeletePending(resourceID *commands.ResourceId, eventMetadata *events.EventMetadata, auditContext *commands.AuditContext, validUntil time.Time) eventstore.EventUnmarshaler
func MakeResourceDeleted ¶
func MakeResourceDeleted(resourceID *commands.ResourceId, status commands.Status, content *commands.Content, eventMetadata *events.EventMetadata, auditContext *commands.AuditContext) eventstore.EventUnmarshaler
func MakeResourceLinksPublishedEvent ¶
func MakeResourceLinksPublishedEvent(resources []*commands.Resource, deviceID string, eventMetadata *events.EventMetadata) eventstore.EventUnmarshaler
func MakeResourceLinksSnapshotTaken ¶
func MakeResourceLinksSnapshotTaken(resources map[string]*commands.Resource, deviceID string, eventMetadata *events.EventMetadata) eventstore.EventUnmarshaler
func MakeResourceLinksUnpublishedEvent ¶
func MakeResourceLinksUnpublishedEvent(hrefs []string, deviceID string, eventMetadata *events.EventMetadata) eventstore.EventUnmarshaler
func MakeResourceRetrievePending ¶
func MakeResourceRetrievePending(resourceID *commands.ResourceId, resourceInterface string, eventMetadata *events.EventMetadata, auditContext *commands.AuditContext, validUntil time.Time) eventstore.EventUnmarshaler
func MakeResourceRetrieved ¶
func MakeResourceRetrieved(resourceID *commands.ResourceId, status commands.Status, content *commands.Content, eventMetadata *events.EventMetadata, auditContext *commands.AuditContext) eventstore.EventUnmarshaler
func MakeResourceStateSnapshotTaken ¶
func MakeResourceStateSnapshotTaken(resourceID *commands.ResourceId, latestResourceChange *events.ResourceChanged, eventMetadata *events.EventMetadata, auditContext *commands.AuditContext) eventstore.EventUnmarshaler
func MakeResourceUpdatePending ¶
func MakeResourceUpdatePending(resourceID *commands.ResourceId, content *commands.Content, eventMetadata *events.EventMetadata, auditContext *commands.AuditContext, validUntil time.Time) eventstore.EventUnmarshaler
func MakeResourceUpdated ¶
func MakeResourceUpdated(resourceID *commands.ResourceId, status commands.Status, content *commands.Content, eventMetadata *events.EventMetadata, auditContext *commands.AuditContext) eventstore.EventUnmarshaler
Types ¶
type MockEvent ¶
type MockEvent struct { VersionI uint64 `bson:"version"` EventTypeI string `bson:"eventtype"` IsSnapshotI bool `bson:"issnapshot"` AggregateIDI string `bson:"aggregateid"` GroupIDI string `bson:"groupid"` DataI []byte `bson:"data"` TimestampI int64 `bson:"timestamp"` }
func (MockEvent) AggregateID ¶
func (MockEvent) IsSnapshot ¶
type MockEventHandler ¶
type MockEventHandler struct {
// contains filtered or unexported fields
}
func NewMockEventHandler ¶
func NewMockEventHandler() *MockEventHandler
func (*MockEventHandler) Contains ¶
func (eh *MockEventHandler) Contains(event eventstore.Event) bool
func (*MockEventHandler) ContainsGroupID ¶
func (eh *MockEventHandler) ContainsGroupID(groupID string) bool
func (*MockEventHandler) Count ¶
func (eh *MockEventHandler) Count() int
func (*MockEventHandler) Equals ¶
func (eh *MockEventHandler) Equals(events []eventstore.Event) bool
func (*MockEventHandler) Handle ¶
func (eh *MockEventHandler) Handle(ctx context.Context, iter eventstore.Iter) error
func (*MockEventHandler) SetElement ¶
func (eh *MockEventHandler) SetElement(groupID, aggregateID string, e MockEvent)
func (*MockEventHandler) SnapshotEventType ¶
func (eh *MockEventHandler) SnapshotEventType() string
type MockEventStore ¶
type MockEventStore struct {
// contains filtered or unexported fields
}
func NewMockEventStore ¶
func NewMockEventStore() *MockEventStore
func (*MockEventStore) Append ¶
func (s *MockEventStore) Append(groupID, aggregateID string, ev eventstore.EventUnmarshaler)
func (*MockEventStore) Delete ¶
func (s *MockEventStore) Delete(ctx context.Context, queries []eventstore.DeleteQuery) error
Delete aggregates events for specific group ids.
func (*MockEventStore) GetEvents ¶
func (s *MockEventStore) GetEvents(ctx context.Context, queries []eventstore.GetEventsQuery, timestamp int64, eventHandler eventstore.Handler) error
func (*MockEventStore) LoadFromSnapshot ¶
func (s *MockEventStore) LoadFromSnapshot(ctx context.Context, queries []eventstore.SnapshotQuery, eventHandler eventstore.Handler) error
func (*MockEventStore) LoadFromVersion ¶
func (s *MockEventStore) LoadFromVersion(ctx context.Context, queries []eventstore.VersionQuery, eventHandler eventstore.Handler) error
func (*MockEventStore) LoadUpToVersion ¶
func (s *MockEventStore) LoadUpToVersion(ctx context.Context, queries []eventstore.VersionQuery, eventHandler eventstore.Handler) error
LoadUpToVersion loads aggregate events up to a specific version.
func (*MockEventStore) RemoveUpToVersion ¶
func (s *MockEventStore) RemoveUpToVersion(ctx context.Context, queries []eventstore.VersionQuery) error
RemoveUpToVersion deletes the aggregates events up to a specific version.
func (*MockEventStore) Save ¶
func (s *MockEventStore) Save(ctx context.Context, events ...eventstore.Event) (eventstore.SaveStatus, error)
Click to show internal directories.
Click to hide internal directories.