events

package
v0.0.0-...-c20f874 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 27, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

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

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 S3Bucket

type S3Bucket struct {
	Name string
	Arn  string
}

S3Bucket mirrors events.S3Bucket type, removing unused fields.

type S3Entity

type S3Entity struct {
	Bucket S3Bucket
	Object S3Object
}

S3Entity mirrors events.S3Entity type, removing unused fields.

type S3Event

type S3Event struct {
	Records []S3EventRecord
}

S3Event mirrors events.S3Event type, removing unused fields.

type S3EventRecord

type S3EventRecord struct {
	EventSource string
	EventTime   time.Time
	EventName   string
	S3          S3Entity
}

S3EventRecord mirrors events.S3EventRecord type, removing unused fields.

type S3Object

type S3Object struct {
	Key  string
	Size int64
	ETag string
}

S3Object mirrors events.S3Object 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

type SQSMessageAttribute struct {
	StringValue *string
	BinaryValue []byte
	DataType    string
}

SQSMessageAttribute mirrors events.SQSMessageAttribute type, removing unused fields.

type StepFunctionEvent

type StepFunctionEvent struct {
	Payload StepFunctionPayload
}

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 {}

type StepFunctionPayload

type StepFunctionPayload struct {
	Execution struct {
		ID string
	}
	State struct {
		Name        string
		EnteredTime string
	}
}

StepFunctionPayload is the payload of a StepFunctionEvent. It's also a non-legacy version of the `StepFunctionEvent`.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL