Documentation
¶
Overview ¶
Package fixtures is a set of test fixtures and mocks for DynamoDB projections.
Index ¶
- type MessageHandler
- func (h *MessageHandler) Compact(ctx context.Context, client *dynamodb.Client, s dogma.ProjectionCompactScope) error
- func (h *MessageHandler) Configure(c dogma.ProjectionConfigurer)
- func (h *MessageHandler) HandleEvent(ctx context.Context, s dogma.ProjectionEventScope, m dogma.Event) ([]types.TransactWriteItem, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MessageHandler ¶
type MessageHandler struct {
ConfigureFunc func(c dogma.ProjectionConfigurer)
HandleEventFunc func(ctx context.Context, s dogma.ProjectionEventScope, m dogma.Event) ([]types.TransactWriteItem, error)
CompactFunc func(context.Context, *dynamodb.Client, dogma.ProjectionCompactScope) error
}
MessageHandler is a test implementation of dynamoprojection.MessageHandler.
func (*MessageHandler) Compact ¶
func (h *MessageHandler) Compact(ctx context.Context, client *dynamodb.Client, s dogma.ProjectionCompactScope) error
Compact reduces the size of the projection's data.
If h.CompactFunc is non-nil it returns h.CompactFunc(ctx,db,s), otherwise it returns nil.
func (*MessageHandler) Configure ¶
func (h *MessageHandler) Configure(c dogma.ProjectionConfigurer)
Configure configures the behavior of the engine as it relates to this handler.
c provides access to the various configuration options, such as specifying which types of event messages are routed to this handler.
If h.ConfigureFunc is non-nil, it calls h.ConfigureFunc(c).
func (*MessageHandler) HandleEvent ¶
func (h *MessageHandler) HandleEvent( ctx context.Context, s dogma.ProjectionEventScope, m dogma.Event, ) ([]types.TransactWriteItem, error)
HandleEvent handles a domain event message that has been routed to this handler.
If h.HandleEventFunc is non-nil it returns h.HandleEventFunc(ctx, s, m).