chiadapter

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Packge chilambda add Chi 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 Chi mux.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ChiLambda

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

ChiLambda makes it easy to send API Gateway proxy events to a Chi Mux. 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(chi *chi.Mux) *ChiLambda

New creates a new instance of the ChiLambda object. Receives an initialized *chi.Mux object - normally created with chi.NewRouter(). It returns the initialized instance of the ChiLambda object.

func (*ChiLambda) Proxy

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

func (*ChiLambda) ProxyWithContext

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

type ChiLambdaV2

type ChiLambdaV2 struct {
	core.RequestAccessorV2
	// contains filtered or unexported fields
}

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

func NewV2

func NewV2(chi *chi.Mux) *ChiLambdaV2

New creates a new instance of the ChiLambdaV2 object. Receives an initialized *chi.Mux object - normally created with chi.NewRouter(). It returns the initialized instance of the ChiLambdaV2 object.

func (*ChiLambdaV2) Proxy

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

func (*ChiLambdaV2) ProxyWithContextV2

ProxyWithContext receives context and an API Gateway proxy V2 event, transforms them into an http.Request object, and sends it to the chi.Mux 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