Documentation ¶
Overview ¶
Package chiadapter 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 ¶
func (g *ChiLambda) 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 chi.Mux for routing. It returns a proxy response object generated from the http.ResponseWriter.
func (*ChiLambda) ProxyWithContext ¶
func (g *ChiLambda) 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 chi.Mux for routing. It returns a proxy response object generated from the http.ResponseWriter.
type ChiLambdaALB ¶
type ChiLambdaALB struct { core.RequestAccessorALB Chi *chi.Mux }
ChiLambdaALB makes it easy to send ALB 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 NewALB ¶
func NewALB(chi *chi.Mux) *ChiLambdaALB
NewALB creates a new instance of the ChiLambdaALB object. Receives an initialized *chi.Mux object - normally created with chi.New(). It returns the initialized instance of the ChiLambdaALB object.
func (*ChiLambdaALB) Proxy ¶
func (c *ChiLambdaALB) Proxy(req events.ALBTargetGroupRequest) (events.ALBTargetGroupResponse, error)
Proxy receives an ALB 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 (*ChiLambdaALB) ProxyWithContext ¶
func (c *ChiLambdaALB) ProxyWithContext(ctx context.Context, req events.ALBTargetGroupRequest) (events.ALBTargetGroupResponse, error)
ProxyWithContext receives an ALB 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.
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 ¶
func (g *ChiLambdaV2) Proxy(req events.APIGatewayV2HTTPRequest) (events.APIGatewayV2HTTPResponse, error)
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 ¶
func (g *ChiLambdaV2) ProxyWithContextV2(ctx context.Context, req events.APIGatewayV2HTTPRequest) (events.APIGatewayV2HTTPResponse, error)
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.