Documentation ¶
Overview ¶
Package kinesisfirehoseevt allows you to write AWS Lambda functions to transform incoming Amazon Kinesis Firehose source data and deliver the transformed data to destinations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Input ¶
type Input struct { // The invocation ID. InvocationID string // The ARN of the Amazon Kinesis Firehose. DeliveryStreamARN string // The AWS region where the event originated. Region string // The list of Amazon Kinesis Firehose event records. Records []*InputRecord }
Input represents an Amazon Kinesis Firehose delivery stream event and provides contextual information.
type InputRecord ¶
type InputRecord struct { // The unique identifier of the record passed from // Amazon Kinesis Firehose to AWS Lambda. RecordID string // The approximate time that the record was inserted into the // Amazon Kinesis Firehose delivery stream. This is set when a delivery // stream successfully receives and stores a record and is commonly // referred to as a server-side timestamp. It has millisecond precision // and there are no guarantees about its accuracy, or that it is always // increasing. For example, records in a specific // Amazon Kinesis Firehose delivery stream might have timestamps that // are out of order. ApproximateArrivalTimestamp time.Time // The data blob. The data in the blob is both opaque and immutable to // the Amazon Kinesis Firehose service, which does not inspect, // interpret, or change the data in the blob in any way. The data blob // consists of any kind of data and the total size must not exceed the // maximum record size (1 MB). // Data is automatically base64 encoded/decoded by the SDK. Data []byte }
InputRecord represents the unit of data of an Amazon Kinesis Firehose event.
func (*InputRecord) MarshalJSON ¶
func (r *InputRecord) MarshalJSON() ([]byte, error)
MarshalJSON reverts the effect of type aliasing and struct embedding used during the marshalling step to make the pattern seamless.
func (*InputRecord) UnmarshalJSON ¶
func (r *InputRecord) UnmarshalJSON(data []byte) error
UnmarshalJSON interprets data as a Record with a special timestamp. It then leverages type aliasing and struct embedding to fill Record with an usual time.Time.
type Output ¶
type Output struct { // Transformed Amazon Kinesis Firehose records. Records []*OutputRecord `json:"records"` }
Output represents the result of the processing of Amazon Kinesis Firehose input records.
type OutputRecord ¶
type OutputRecord struct { // The record ID is passed from Amazon Kinesis Firehose to AWS Lambda // during the invocation. The transformed record must contain the same // record ID. Any mismatch between the ID of the original record and the // ID of the transformed record is treated as a data transformation // failure. RecordID string `json:"recordId"` // The status of the data transformation of the record. The possible // values are: // - "Ok": the record was transformed successfully. // - "Dropped": the record was dropped intentionally by your processing // logic. // - "ProcessingFailed": the record could not be transformed. // If a record has a status of "Ok" or "Dropped", // Amazon Kinesis firehose considers it successfully processed. // Otherwise, Amazon Kinesis Firehose considers it unsuccessfully // processed. Result string `json:"result"` // The transformed data payload, after base64-encoding. Data []byte `json:"data"` }
OutputRecord represents the transformed Amazon Kinesis Firehose record