Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
ErrInvalidAPIGatewayRequest = errors.New("gateway: invalid APIGateway request struct configured")
)
Functions ¶
This section is empty.
Types ¶
type Gateway ¶
type Gateway[T any] struct { // contains filtered or unexported fields }
Gateway wraps an http handler to enable use as a lambda.Handler
func New ¶
New creates a gateway using the provided http.Handler enabling use in existing aws-lambda-go projects
func (*Gateway[T]) GetInvoker ¶
GetInvoker returns the function that will be invoked by the lambda.Start call in the main function. This function will be decorated or not depending on the options passed to the New function.
type Option ¶
type Option func(*options)
Option is a functional option for configuring the gateway.
func WithDecorator ¶
WithDecorator adds a Decorator function to the options for processing handlers.
func WithDefaultErrorHeaders ¶
WithDefaultErrorHeaders sets a default error response header to be used in the options if the provided map is not empty.
func WithDefaultErrorResponse ¶
WithDefaultErrorResponse sets a default error response string to be used in the options if the provided string is not empty.
func WithHTTPHandler ¶
WithHTTPHandler sets the provided http.Handler to the options' configuration.
func WithHandlerProvider ¶ added in v0.1.0
func WithHandlerProvider(p HandlerProvider) Option
WithHandlerProvider sets a custom HandlerProvider to lazily initialize the HTTP handler with context propagation.
func WithLogger ¶ added in v0.0.3
WithLogger sets the provided Logger instance to the options' configuration.