Skip to content

Commit

Permalink
Create BatchItemFailure structs for DynamoDB, Kinesis, SQS (#410)
Browse files Browse the repository at this point in the history
* Create streams.go

* go fmt

* Split StreamsEventResponse into duplicate structs

Co-authored-by: Bryan Moffatt <bmoffatt@users.noreply.github.com>
Co-authored-by: Carl Zogheib <carlzogh@amazon.com>
  • Loading branch information
3 people authored Jan 7, 2022
1 parent 96ab249 commit d9db870
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions events/streams.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package events

// KinesisEventResponse is the outer structure to report batch item failures for KinesisEvent.
type KinesisEventResponse struct {
BatchItemFailures []KinesisBatchItemFailure `json:"batchItemFailures"`
}

// KinesisBatchItemFailure is the individual record which failed processing.
type KinesisBatchItemFailure struct {
ItemIdentifier string `json:"itemIdentifier"`
}

// DynamoDBEventResponse is the outer structure to report batch item failures for DynamoDBEvent.
type DynamoDBEventResponse struct {
BatchItemFailures []DynamoDBBatchItemFailure `json:"batchItemFailures"`
}

// DynamoDBBatchItemFailure is the individual record which failed processing.
type DynamoDBBatchItemFailure struct {
ItemIdentifier string `json:"itemIdentifier"`
}

// SQSEventResponse is the outer structure to report batch item failures for SQSEvent.
type SQSEventResponse struct {
BatchItemFailures []SQSBatchItemFailure `json:"batchItemFailures"`
}

// SQSBatchItemFailure is the individual record which failed processing.
type SQSBatchItemFailure struct {
ItemIdentifier string `json:"itemIdentifier"`
}

0 comments on commit d9db870

Please sign in to comment.