Documentation ¶
Index ¶
- func GetAPIGatewayContextFromContext(ctx context.Context) (events.APIGatewayProxyRequestContext, bool)
- func GetRuntimeContextFromContext(ctx context.Context) (*lambdacontext.LambdaContext, bool)
- func GetStageVarsFromContext(ctx context.Context) (map[string]string, bool)
- func ProxyResponse(rec *httptest.ResponseRecorder) (out events.APIGatewayProxyResponse)
- func WithContext(ctx context.Context, apiGwRequest events.APIGatewayProxyRequest) context.Context
- type Adapter
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAPIGatewayContextFromContext ¶ added in v0.9.1
func GetAPIGatewayContextFromContext(ctx context.Context) (events.APIGatewayProxyRequestContext, bool)
GetAPIGatewayContextFromContext retrieve APIGatewayProxyRequestContext from context.Context
func GetRuntimeContextFromContext ¶ added in v0.9.1
func GetRuntimeContextFromContext(ctx context.Context) (*lambdacontext.LambdaContext, bool)
GetRuntimeContextFromContext retrieve Lambda Runtime Context from context.Context
func GetStageVarsFromContext ¶ added in v0.9.1
GetStageVarsFromContext retrieve stage variables from context
func ProxyResponse ¶
func ProxyResponse(rec *httptest.ResponseRecorder) (out events.APIGatewayProxyResponse)
ProxyResponse returns the resulting response to handling the API Gateway Proxy event
func WithContext ¶ added in v0.9.2
WithContext returns a context with gateway context and lamda context added (if any)
Types ¶
type Adapter ¶
type Adapter struct {
// contains filtered or unexported fields
}
Adapter adapts http.Handler implementations.
func (*Adapter) EventToRequest ¶
EventToRequest converts an API Gateway proxy event into an http.Request object. Returns the populated request maintaining headers
func (*Adapter) ProxyWithContext ¶
func (a *Adapter) ProxyWithContext( ctx context.Context, ev events.APIGatewayProxyRequest, ) (out events.APIGatewayProxyResponse, err error)
ProxyWithContext receives context and an API Gateway proxy event, transforms them into an http.Request object, and sends it to the http.Handler for routing. It returns a proxy response object generated from the http.ResponseWriter.
type Option ¶
type Option func(a *Adapter)
Option configures the adapter
func CustomHost ¶
CustomHost configures the custom hostname for the request. If this option is not set the framework reverts to `RequestContext.DomainName`. The value for a custom host should include a protocol: http://my-custom.host.com
func StripBasePath ¶
StripBasePath configures the adapter to strip the prefixing part of the resulting url path