Documentation ¶
Index ¶
- Variables
- func AcceptanceTest(ctx context.Context, t *testing.T, store eventstore.EventStore)
- func GetEventsTest(ctx context.Context, t *testing.T, store eventstore.EventStore)
- func MakeAuditContext(userID string, correlationID string) *commands.AuditContext
- func MakeDeviceMetadata(deviceID string, deviceMetadataUpdated *events.DeviceMetadataUpdated, ...) eventstore.EventUnmarshaler
- func MakeDeviceMetadataUpdatePending(deviceID string, twinEnabled *events.DeviceMetadataUpdatePending_TwinEnabled, ...) eventstore.EventUnmarshaler
- func MakeDeviceMetadataUpdated(deviceID string, connection *commands.Connection, twinEnabled bool, ...) 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(context.Context, []eventstore.DeleteQuery) error
- func (s *MockEventStore) GetEvents(context.Context, []eventstore.GetEventsQuery, int64, eventstore.Handler) 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(context.Context, []eventstore.VersionQuery, eventstore.Handler) error
- func (s *MockEventStore) RemoveUpToVersion(context.Context, []eventstore.VersionQuery) error
- func (s *MockEventStore) Save(context.Context, ...eventstore.Event) (eventstore.SaveStatus, error)
Constants ¶
This section is empty.
Variables ¶
View Source
var (
StaticAuditContext = &commands.AuditContext{
UserId: "userId",
}
)
Functions ¶
func AcceptanceTest ¶
func AcceptanceTest(ctx context.Context, t *testing.T, store eventstore.EventStore)
func GetEventsTest ¶
func GetEventsTest(ctx context.Context, t *testing.T, 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, twinEnabled *events.DeviceMetadataUpdatePending_TwinEnabled, eventMetadata *events.EventMetadata, auditContext *commands.AuditContext, validUntil time.Time) eventstore.EventUnmarshaler
func MakeDeviceMetadataUpdated ¶
func MakeDeviceMetadataUpdated(deviceID string, connection *commands.Connection, twinEnabled bool, 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(context.Context, []eventstore.DeleteQuery) error
Delete aggregates events for specific group ids.
func (*MockEventStore) GetEvents ¶
func (s *MockEventStore) GetEvents(context.Context, []eventstore.GetEventsQuery, int64, 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(context.Context, []eventstore.VersionQuery, eventstore.Handler) error
LoadUpToVersion loads aggregate events up to a specific version.
func (*MockEventStore) RemoveUpToVersion ¶
func (s *MockEventStore) RemoveUpToVersion(context.Context, []eventstore.VersionQuery) error
RemoveUpToVersion deletes the aggregates events up to a specific version.
func (*MockEventStore) Save ¶
func (s *MockEventStore) Save(context.Context, ...eventstore.Event) (eventstore.SaveStatus, error)
Click to show internal directories.
Click to hide internal directories.