Back to godoc.org

Package echov4adapter

v0.6.2
Latest Go to latest

The highest tagged major version is .

Published: May 24, 2020 | License: Apache-2.0 | Module: github.com/mcalpinefree/aws-lambda-go-api-proxy

Overview

Packge echolambda add Echo 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 echo.Echo

Index

type EchoLambda

type EchoLambda struct {
	core.RequestAccessor

	Echo *echo.Echo
}

EchoLambda makes it easy to send API Gateway proxy events to a echo.Echo. The library transforms the proxy event into an HTTP request and then creates a proxy response object from the http.ResponseWriter

func New

func New(e *echo.Echo) *EchoLambda

New creates a new instance of the EchoLambda object. Receives an initialized *echo.Echo object - normally created with echo.New(). It returns the initialized instance of the EchoLambda object.

func (*EchoLambda) Proxy

func (e *EchoLambda) 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 echo.Echo for routing. It returns a proxy response object generated from the http.ResponseWriter.

func (*EchoLambda) ProxyWithContext

func (e *EchoLambda) 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.

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier