lambda

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HelperModule

func HelperModule(extraOptions fx.Option) fx.Option

Types

type Event

type Event struct {
	ID         string    `json:"id"`
	Source     string    `json:"source"`
	Region     string    `json:"region"`
	DetailType string    `json:"detail-type"`
	Time       time.Time `json:"time"`
	Account    string    `json:"account"`
	Resources  []string  `json:"resources"`
	Records    []Record  `json:"Records"`
}

type Handler

type Handler struct {
	// contains filtered or unexported fields
}

func NewHandler

func NewHandler(handler *cloudevents.HandlerWrapper, options *Options) *Handler

func (*Handler) Handle

func (h *Handler) Handle(ctx context.Context, event Event) error

Handler handles a event

type Helper

type Helper struct {
	// contains filtered or unexported fields
}

func NewDefaultHelper

func NewDefaultHelper(handler *cloudevents.HandlerWrapper) *Helper

func NewHelper

func NewHelper(handler *cloudevents.HandlerWrapper, options *Options) *Helper

func (*Helper) Start

func (h *Helper) Start()

type Options

type Options struct {
	Skip bool
}

func DefaultOptions

func DefaultOptions() (*Options, error)

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.S3EventRecord                  `json:"s3"`
	Kinesis                events.KinesisRecord                  `json:"kinesis"`
	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"`
}

Jump to

Keyboard shortcuts

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