Documentation ¶
Overview ¶
Package fiberadapter adds Fiber support for the aws-severless-go-api library. Uses the core package behind the scenes and exposes the New method to get a new instance and Proxy method to send request to the Fiber app.
Index ¶
- type FiberLambda
- func (f *FiberLambda) Proxy(req events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error)
- func (f *FiberLambda) ProxyV2(req events.APIGatewayV2HTTPRequest) (events.APIGatewayV2HTTPResponse, error)
- func (f *FiberLambda) ProxyWithContext(ctx context.Context, req events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error)
- func (f *FiberLambda) ProxyWithContextV2(ctx context.Context, req events.APIGatewayV2HTTPRequest) (events.APIGatewayV2HTTPResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FiberLambda ¶
type FiberLambda struct { core.RequestAccessor // contains filtered or unexported fields }
FiberLambda makes it easy to send API Gateway proxy events to a fiber.App. The library transforms the proxy event into an HTTP request and then creates a proxy response object from the *fiber.Ctx
func New ¶
func New(app *fiber.App) *FiberLambda
New creates a new instance of the FiberLambda object. Receives an initialized *fiber.App object - normally created with fiber.New(). It returns the initialized instance of the FiberLambda object.
func (*FiberLambda) Proxy ¶
func (f *FiberLambda) Proxy(req events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error)
Proxy receives an API Gateway proxy event, transforms it into an http.Request object, and sends it to the fiber.App for routing. It returns a proxy response object generated from the http.ResponseWriter.
func (*FiberLambda) ProxyV2 ¶
func (f *FiberLambda) ProxyV2(req events.APIGatewayV2HTTPRequest) (events.APIGatewayV2HTTPResponse, error)
ProxyV2 is just same as Proxy() but for APIGateway HTTP payload v2
func (*FiberLambda) ProxyWithContext ¶
func (f *FiberLambda) ProxyWithContext(ctx context.Context, req events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error)
ProxyWithContext receives context and an API Gateway proxy event, transforms them into an http.Request object, and sends it to the echo.Echo for routing. It returns a proxy response object generated from the http.ResponseWriter.
func (*FiberLambda) ProxyWithContextV2 ¶
func (f *FiberLambda) ProxyWithContextV2(ctx context.Context, req events.APIGatewayV2HTTPRequest) (events.APIGatewayV2HTTPResponse, error)
ProxyWithContextV2 is just same as ProxyWithContext() but for APIGateway HTTP payload v2