ginadapter

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2021 License: Apache-2.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GinFaas

type GinFaas struct {
	core.RequestAccessor
	// contains filtered or unexported fields
}

GinFaas makes it easy to send API Gateway proxy events to a Gin

func New

func New(gin *gin.Engine) *GinFaas

New creates a new instance of the GinFaas object. Receives an initialized *gin.Engine object - normally created with gin.Default(). It returns the initialized instance of the GinFaas object.

func (*GinFaas) Proxy

Proxy receives an API Gateway proxy event, transforms it into an http.Request object, and sends it to the gin.Engine for routing. It returns a proxy response object generated from the http.ResponseWriter.

func (*GinFaas) ProxyWithContext

func (g *GinFaas) ProxyWithContext(ctx context.Context, req events.APIGatewayRequest) (events.APIGatewayResponse, error)

ProxyWithContext receives context and an API Gateway proxy event, transforms them into an http.Request object, and sends it to the gin.Engine for routing. It returns a proxy response object generated from the http.ResponseWriter.

Jump to

Keyboard shortcuts

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