Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Event ¶
type Event struct {
ID string `json:"id"`
Source string `json:"source"`
Region string `json:"region"`
DetailType string `json:"detail-type"`
Detail json.RawMessage `json:"detail"`
Time time.Time `json:"time"`
Account string `json:"account"`
Resources []string `json:"resources"`
Records []Record `json:"Records"`
}
Event is the payload of one invocation: the records of an SQS, SNS, Kinesis, S3 or DynamoDB trigger, or an EventBridge (CloudWatch Events) event, which has no records.
type Handler ¶
type Handler[T any] struct { // contains filtered or unexported fields }
Handler turns each record of a Lambda invocation into a CloudEvent and calls the function handler with it.
func NewHandler ¶
NewHandler returns a Handler that calls fn with the given options.
type Options ¶
type Options struct {
// Skip acknowledges every invocation without calling the handler.
Skip bool
// MaxWorkers bounds the records of one invocation handled at the same
// time; 1 handles them in the order Lambda delivered them.
MaxWorkers int
}
Options configures the Lambda adapter.
func NewOptions ¶
NewOptions returns the options read from config.
type Record ¶
type Record struct {
EventVersion string `json:"eventVersion"`
EventSubscriptionArn string `json:"eventSubscriptionArn"`
EventSource string `json:"eventSource"`
EventName string `json:"eventName"`
EventID string `json:"eventID"`
SNS events.SNSEntity `json:"sns"`
S3 events.S3Entity `json:"s3"`
Kinesis events.KinesisRecord `json:"kinesis"`
DynamoDB events.DynamoDBStreamRecord `json:"dynamodb"`
MessageId string `json:"messageId"`
ReceiptHandle string `json:"receiptHandle"`
Body string `json:"body"`
Md5OfBody string `json:"md5OfBody"`
Md5OfMessageAttributes string `json:"md5OfMessageAttributes"`
Attributes map[string]string `json:"attributes"`
MessageAttributes map[string]events.SQSMessageAttribute `json:"messageAttributes"`
EventSourceARN string `json:"eventSourceARN"`
AWSRegion string `json:"awsRegion"`
UserIdentity *events.DynamoDBUserIdentity `json:"userIdentity"`
}
Record is one record of a trigger; only the fields of its EventSource are set.
Click to show internal directories.
Click to hide internal directories.