handler_utils

package
v1.49.0 Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2022 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddRequestIDToHeaders

func AddRequestIDToHeaders(requestID *string, headers map[string]string, requestIDHeaderKey string)

func GetRecord

func GetRecord(s3Session *s3.SessionWithHelpers, bucket string, message events.SQSMessage, recordType reflect.Type) (interface{}, error)

func RequestIDFromHeaders

func RequestIDFromHeaders(headers map[string]string, requestIDHeaderKey string) *string

func RequestIDFromLambdaContext

func RequestIDFromLambdaContext(ctx context.Context) *string

func ValidateAPIEndpoints

func ValidateAPIEndpoints(endpoints map[string]map[string]interface{}) (map[string]map[string]interface{}, error)

ValidateAPIEndpoints checks that all API endpoints are correctly defined using one of the supported handler types return updated endpoints with additional information

func ValidateCronHandlers

func ValidateCronHandlers(handlers map[string]func() error) (map[string]func() error, error)

ValidateCronHandlers checks that all handlers are correctly defined using one of the supported handler types return updated handlers (with additional information -> N/A for cron)

func ValidateRequestParams

func ValidateRequestParams(request *events.APIGatewayProxyRequest, paramsStructType reflect.Type) (reflect.Value, error)

func ValidateSQSEndpoints

func ValidateSQSEndpoints(endpoints map[string]interface{}) (map[string]interface{}, error)

ValidateSQSEndpoints checks that all SQS endpoints are correctly defined using one of the supported handler types return updated endpoints with additional information

Types

type Handler

type Handler struct {
	RequestParamsType reflect.Type
	RequestBodyType   reflect.Type
	ResponseType      reflect.Type
	FuncValue         reflect.Value
}

func NewHandler

func NewHandler(handlerFunction interface{}) (Handler, error)

type IValidator

type IValidator interface {
	Validate() error
}

type SQSHandler

type SQSHandler struct {
	RecordType reflect.Type
	FuncValue  reflect.Value
}

func NewSQSHandler

func NewSQSHandler(fnc interface{}) (SQSHandler, error)

Jump to

Keyboard shortcuts

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