Documentation ¶
Overview ¶
Package ginadapter adds Gin support for the aws-severless-go-api library. Uses the core package behind the scenes and exposes the New and NewV2 methods to get a new instance and Proxy method to send request to the Gin engine.
Package ginadapter adds Gin support for the aws-severless-go-api library. Uses the core package behind the scenes and exposes the New and NewV2 and ALB methods to get a new instance and Proxy method to send request to the Gin engine.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GinLambda ¶
type GinLambda struct { core.RequestAccessor // contains filtered or unexported fields }
GinLambda makes it easy to send API Gateway proxy events to a Gin Engine. The library transforms the proxy event into an HTTP request and then creates a proxy response object from the http.ResponseWriter
func New ¶
New creates a new instance of the GinLambda object. Receives an initialized *gin.Engine object - normally created with gin.Default(). It returns the initialized instance of the GinLambda object.
func (*GinLambda) Proxy ¶
func (g *GinLambda) 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 gin.Engine for routing. It returns a proxy response object generated from the http.ResponseWriter.
func (*GinLambda) ProxyWithContext ¶ added in v0.3.0
func (g *GinLambda) 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 gin.Engine for routing. It returns a proxy response object generated from the http.ResponseWriter.
type GinLambdaALB ¶ added in v0.14.0
type GinLambdaALB struct { core.RequestAccessorALB // contains filtered or unexported fields }
GinLambdaALB makes it easy to send ALB proxy events to a Gin Engine. The library transforms the proxy event into an HTTP request and then creates a proxy response object from the http.ResponseWriter
func NewALB ¶ added in v0.14.0
func NewALB(gin *gin.Engine) *GinLambdaALB
New creates a new instance of the GinLambdaALB object. Receives an initialized *gin.Engine object - normally created with gin.Default(). It returns the initialized instance of the GinLambdaALB object.
func (*GinLambdaALB) Proxy ¶ added in v0.14.0
func (g *GinLambdaALB) 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 gin.Engine for routing. It returns a proxy response object generated from the http.ResponseWriter.
func (*GinLambdaALB) ProxyWithContext ¶ added in v0.14.0
func (g *GinLambdaALB) ProxyWithContext(ctx context.Context, req events.ALBTargetGroupRequest) (events.ALBTargetGroupResponse, error)
ProxyWithContext receives context and an ALB 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.
type GinLambdaV2 ¶ added in v0.11.0
type GinLambdaV2 struct { core.RequestAccessorV2 // contains filtered or unexported fields }
GinLambdaV2 makes it easy to send API Gateway proxy V2 events to a Gin Engine. The library transforms the proxy event into an HTTP request and then creates a proxy response object from the http.ResponseWriter
func NewV2 ¶ added in v0.11.0
func NewV2(gin *gin.Engine) *GinLambdaV2
NewV2 creates a new instance of the GinLambdaV2 object. Receives an initialized *gin.Engine object - normally created with gin.Default(). It returns the initialized instance of the GinLambdaV2 object.
func (*GinLambdaV2) Proxy ¶ added in v0.11.0
func (g *GinLambdaV2) 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 gin.Engine for routing. It returns an http response object generated from the http.ResponseWriter.
func (*GinLambdaV2) ProxyWithContext ¶ added in v0.11.0
func (g *GinLambdaV2) ProxyWithContext(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 gin.Engine for routing. It returns an http response object generated from the http.ResponseWriter.