Documentation
¶
Overview ¶
Package events provides a series of drop in replacements for "github.com/aws/aws-lambda-go/events". Using these types for json unmarshalling event payloads provides huge reduction in processing time. This means fewer map/slice allocations since only the fields which we will use will be unmarshalled.
Index ¶
- type ALBTargetGroupRequest
- type ALBTargetGroupRequestContext
- type APIGatewayCustomAuthorizerRequest
- type APIGatewayCustomAuthorizerRequestTypeRequest
- type APIGatewayCustomAuthorizerRequestTypeRequestContext
- type APIGatewayProxyRequest
- type APIGatewayProxyRequestContext
- type APIGatewayV2HTTPRequest
- type APIGatewayV2HTTPRequestContext
- type APIGatewayV2HTTPRequestContextHTTPDescription
- type APIGatewayWebsocketProxyRequest
- type APIGatewayWebsocketProxyRequestContext
- type CloudWatchEvent
- type CloudwatchLogsData
- type CloudwatchLogsEvent
- type CloudwatchLogsRawData
- type DynamoDBEvent
- type DynamoDBEventRecord
- type DynamoDBStreamRecord
- type ELBContext
- type EventBridgeEvent
- type KinesisEvent
- type KinesisEventRecord
- type KinesisRecord
- type LambdaFunctionURLRequest
- type LambdaFunctionURLRequestContext
- type LambdaFunctionURLRequestContextHTTPDescription
- type LambdaRootStepFunctionPayload
- type NestedStepFunctionPayload
- type S3Bucket
- type S3Entity
- type S3Event
- type S3EventRecord
- type S3Object
- type SNSEntity
- type SNSEvent
- type SNSEventRecord
- type SQSEvent
- type SQSMessage
- type SQSMessageAttribute
- type StepFunctionEvent
- type StepFunctionPayload
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ALBTargetGroupRequest ¶
type ALBTargetGroupRequest struct {
HTTPMethod string
Path string
Headers map[string]string
MultiValueHeaders map[string][]string
RequestContext ALBTargetGroupRequestContext
}
ALBTargetGroupRequest mirrors events.ALBTargetGroupRequest type, removing unused fields.
type ALBTargetGroupRequestContext ¶
type ALBTargetGroupRequestContext struct {
ELB ELBContext
}
ALBTargetGroupRequestContext mirrors events.ALBTargetGroupRequestContext type, removing unused fields.
type APIGatewayCustomAuthorizerRequest ¶
type APIGatewayCustomAuthorizerRequest struct {
Type string
AuthorizationToken string
MethodArn string
}
APIGatewayCustomAuthorizerRequest mirrors events.APIGatewayCustomAuthorizerRequest type, removing unused fields.
type APIGatewayCustomAuthorizerRequestTypeRequest ¶
type APIGatewayCustomAuthorizerRequestTypeRequest struct {
MethodArn string
Resource string
HTTPMethod string
Headers map[string]string
RequestContext APIGatewayCustomAuthorizerRequestTypeRequestContext
}
APIGatewayCustomAuthorizerRequestTypeRequest mirrors events.APIGatewayCustomAuthorizerRequestTypeRequest type, removing unused fields.
type APIGatewayCustomAuthorizerRequestTypeRequestContext ¶
type APIGatewayCustomAuthorizerRequestTypeRequestContext struct {
Path string
}
APIGatewayCustomAuthorizerRequestTypeRequestContext mirrors events.APIGatewayCustomAuthorizerRequestTypeRequestContext type, removing unused fields.
type APIGatewayProxyRequest ¶
type APIGatewayProxyRequest struct {
Resource string
Path string
HTTPMethod string
Headers map[string]string
RequestContext APIGatewayProxyRequestContext
}
APIGatewayProxyRequest mirrors events.APIGatewayProxyRequest type, removing unused fields.
type APIGatewayProxyRequestContext ¶
type APIGatewayProxyRequestContext struct {
Stage string
DomainName string
RequestID string
Path string
HTTPMethod string
RequestTimeEpoch int64
APIID string
}
APIGatewayProxyRequestContext mirrors events.APIGatewayProxyRequestContext type, removing unused fields.
type APIGatewayV2HTTPRequest ¶
type APIGatewayV2HTTPRequest struct {
RouteKey string
Headers map[string]string
RequestContext APIGatewayV2HTTPRequestContext
}
APIGatewayV2HTTPRequest mirrors events.APIGatewayV2HTTPRequest type, removing unused fields.
type APIGatewayV2HTTPRequestContext ¶
type APIGatewayV2HTTPRequestContext struct {
Stage string
RequestID string
APIID string
DomainName string
TimeEpoch int64
HTTP APIGatewayV2HTTPRequestContextHTTPDescription
}
APIGatewayV2HTTPRequestContext mirrors events.APIGatewayV2HTTPRequestContext type, removing unused fields.
type APIGatewayV2HTTPRequestContextHTTPDescription ¶
type APIGatewayV2HTTPRequestContextHTTPDescription struct {
Method string
Path string
Protocol string
SourceIP string
UserAgent string
}
APIGatewayV2HTTPRequestContextHTTPDescription mirrors events.APIGatewayV2HTTPRequestContextHTTPDescription type, removing unused fields.
type APIGatewayWebsocketProxyRequest ¶
type APIGatewayWebsocketProxyRequest struct {
Headers map[string]string
RequestContext APIGatewayWebsocketProxyRequestContext
}
APIGatewayWebsocketProxyRequest mirrors events.APIGatewayWebsocketProxyRequest type, removing unused fields.
type APIGatewayWebsocketProxyRequestContext ¶
type APIGatewayWebsocketProxyRequestContext struct {
Stage string
RequestID string
APIID string
ConnectionID string
DomainName string
EventType string
MessageDirection string
RequestTimeEpoch int64
RouteKey string
}
APIGatewayWebsocketProxyRequestContext mirrors events.APIGatewayWebsocketProxyRequestContext type, removing unused fields.
type CloudWatchEvent ¶
type CloudWatchEvent struct {
Resources []string
}
CloudWatchEvent mirrors events.CloudWatchEvent type, removing unused fields.
type CloudwatchLogsData ¶
type CloudwatchLogsData struct {
LogGroup string
}
CloudwatchLogsData mirrors events.CloudwatchLogsData type, removing unused fields.
type CloudwatchLogsEvent ¶
type CloudwatchLogsEvent struct {
AWSLogs CloudwatchLogsRawData
}
CloudwatchLogsEvent mirrors events.CloudwatchLogsEvent type, removing unused fields.
type CloudwatchLogsRawData ¶
type CloudwatchLogsRawData struct {
Data string
}
CloudwatchLogsRawData mirrors events.CloudwatchLogsRawData type, removing unused fields.
func (CloudwatchLogsRawData) Parse ¶
func (c CloudwatchLogsRawData) Parse() (d CloudwatchLogsData, err error)
Parse returns a struct representing a usable CloudwatchLogs event
type DynamoDBEvent ¶
type DynamoDBEvent struct {
Records []DynamoDBEventRecord
}
DynamoDBEvent mirrors events.DynamoDBEvent type, removing unused fields.
type DynamoDBEventRecord ¶
type DynamoDBEventRecord struct {
Change DynamoDBStreamRecord `json:"dynamodb"`
EventID string
EventName string
EventVersion string
EventSourceArn string
}
DynamoDBEventRecord mirrors events.DynamoDBEventRecord type, removing unused fields.
type DynamoDBStreamRecord ¶
type DynamoDBStreamRecord struct {
ApproximateCreationDateTime events.SecondsEpochTime
SizeBytes int64
StreamViewType string
}
DynamoDBStreamRecord mirrors events.DynamoDBStreamRecord type, removing unused fields.
type ELBContext ¶
type ELBContext struct {
TargetGroupArn string
}
ELBContext mirrors events.ELBContext type, removing unused fields.
type EventBridgeEvent ¶
type EventBridgeEvent struct {
DetailType string `json:"detail-type"`
Source string
Time time.Time
Detail struct {
TraceContext map[string]string `json:"_datadog"`
}
}
EventBridgeEvent is used for unmarshalling a EventBridge event. AWS Go libraries do not provide this type of event for deserialization.
type KinesisEvent ¶
type KinesisEvent struct {
Records []KinesisEventRecord
}
KinesisEvent mirrors events.KinesisEvent type, removing unused fields.
type KinesisEventRecord ¶
type KinesisEventRecord struct {
EventID string
EventName string
EventSourceArn string
EventVersion string
Kinesis KinesisRecord
}
KinesisEventRecord mirrors events.KinesisEventRecord type, removing unused fields.
type KinesisRecord ¶
type KinesisRecord struct {
ApproximateArrivalTimestamp events.SecondsEpochTime
PartitionKey string
}
KinesisRecord mirrors events.KinesisRecord type, removing unused fields.
type LambdaFunctionURLRequest ¶
type LambdaFunctionURLRequest struct {
Headers map[string]string
RequestContext LambdaFunctionURLRequestContext
}
LambdaFunctionURLRequest mirrors events.LambdaFunctionURLRequest type, removing unused fields.
type LambdaFunctionURLRequestContext ¶
type LambdaFunctionURLRequestContext struct {
RequestID string
APIID string
DomainName string
TimeEpoch int64
HTTP LambdaFunctionURLRequestContextHTTPDescription
}
LambdaFunctionURLRequestContext mirrors events.LambdaFunctionURLRequestContext type, removing unused fields.
type LambdaFunctionURLRequestContextHTTPDescription ¶
type LambdaFunctionURLRequestContextHTTPDescription struct {
Method string
Path string
Protocol string
SourceIP string
UserAgent string
}
LambdaFunctionURLRequestContextHTTPDescription mirrors events.LambdaFunctionURLRequestContextHTTPDescription type, removing unused fields.
type LambdaRootStepFunctionPayload ¶
type LambdaRootStepFunctionPayload struct {
Payload StepFunctionPayload
TraceID string
TraceTags string
ServerlessVersion string
}
LambdaRootStepFunctionPayload contains a StepFunctionPayload but also has the Trace ID of the top-most Lambda in the trace
func (*LambdaRootStepFunctionPayload) UnmarshalJSON ¶
func (l *LambdaRootStepFunctionPayload) UnmarshalJSON(data []byte) error
UnmarshalJSON for LambdaRootStepFunctionPayload.
type NestedStepFunctionPayload ¶
type NestedStepFunctionPayload struct {
Payload StepFunctionPayload
RootExecutionID string
ServerlessVersion string
}
NestedStepFunctionPayload contains a StepFunctionPayload but also has the Execution ID of the top-most Step Function in the trace
func (*NestedStepFunctionPayload) UnmarshalJSON ¶
func (n *NestedStepFunctionPayload) UnmarshalJSON(data []byte) error
UnmarshalJSON for NestedStepFunctionPayload.
type S3Event ¶
type S3Event struct {
Records []S3EventRecord
}
S3Event mirrors events.S3Event type, removing unused fields.
type S3EventRecord ¶
S3EventRecord mirrors events.S3EventRecord type, removing unused fields.
type SNSEntity ¶
type SNSEntity struct {
MessageID string
Type string
TopicArn string
MessageAttributes map[string]interface{}
Timestamp time.Time
Subject string
Message string
}
SNSEntity mirrors events.SNSEntity type, removing unused fields.
type SNSEvent ¶
type SNSEvent struct {
Records []SNSEventRecord
}
SNSEvent mirrors events.SNSEvent type, removing unused fields.
type SNSEventRecord ¶
type SNSEventRecord struct {
SNS SNSEntity
}
SNSEventRecord mirrors events.SNSEventRecord type, removing unused fields.
type SQSEvent ¶
type SQSEvent struct {
Records []SQSMessage
}
SQSEvent mirrors events.SQSEvent type, removing unused fields.
type SQSMessage ¶
type SQSMessage struct {
ReceiptHandle string
Body string
Attributes map[string]string
MessageAttributes map[string]SQSMessageAttribute
EventSourceARN string
}
SQSMessage mirrors events.SQSMessage type, removing unused fields.
type SQSMessageAttribute ¶
SQSMessageAttribute mirrors events.SQSMessageAttribute type, removing unused fields.
type StepFunctionEvent ¶
type StepFunctionEvent[T any] struct { Payload T }
StepFunctionEvent is the event you get when you instrument a legacy Stepfunction Lambda:Invoke task state as recommended by https://docs.datadoghq.com/serverless/step_functions/installation?tab=custom This isn't an "official" event, as a default StepFunction invocation will just contain {}