/
firehose.go
44 lines (37 loc) · 2.02 KB
/
firehose.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
// Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
package events
// KinesisFirehoseEvent represents the input event from Amazon Kinesis Firehose. It is used as the input parameter.
type KinesisFirehoseEvent struct {
InvocationID string `json:"invocationId"`
DeliveryStreamArn string `json:"deliveryStreamArn"`
SourceKinesisStreamArn string `json:"sourceKinesisStreamArn"`
Region string `json:"region"`
Records []KinesisFirehoseEventRecord `json:"records"`
}
type KinesisFirehoseEventRecord struct {
RecordID string `json:"recordId"`
ApproximateArrivalTimestamp MilliSecondsEpochTime `json:"approximateArrivalTimestamp"`
Data []byte `json:"data"`
KinesisFirehoseRecordMetadata KinesisFirehoseRecordMetadata `json:"kinesisRecordMetadata"`
}
// Constants used for describing the transformation result
const (
KinesisFirehoseTransformedStateOk = "Ok"
KinesisFirehoseTransformedStateDropped = "Dropped"
KinesisFirehoseTransformedStateProcessingFailed = "ProcessingFailed"
)
type KinesisFirehoseResponse struct {
Records []KinesisFirehoseResponseRecord `json:"records"`
}
type KinesisFirehoseResponseRecord struct {
RecordID string `json:"recordId"`
Result string `json:"result"` // The status of the transformation. May be TransformedStateOk, TransformedStateDropped or TransformedStateProcessingFailed
Data []byte `json:"data"`
}
type KinesisFirehoseRecordMetadata struct {
ShardID string `json:"shardId"`
PartitionKey string `json:"partitionKey"`
SequenceNumber string `json:"sequenceNumber"`
SubsequenceNumber string `json:"subsequenceNumber"`
ApproximateArrivalTimestamp MilliSecondsEpochTime `json:"approximateArrivalTimestamp"`
}