Documentation
¶
Overview ¶
Package apigatewayproxy provides a seamless proxy layer which translates Amazon API Gateway requests to Go HTTP requests. By leveraging the Amazon API Gateway Lambda Proxy mode, this package allows to port exsiting Go HTTP applications to Amazon API Gateway & AWS Lambda, without modification.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Response ¶
type Response struct { StatusCode int `json:"statusCode"` Headers map[string]string `json:"headers,omitempty"` Body string `json:"body,omitempty"` IsBase64Encoded bool `json:"isBase64Encoded"` }
Response defines parameters for a well formed response AWS Lambda should return to Amazon API Gateway.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server defines parameters for handling requests coming from Amazon API Gateway. The zero value for Server is not a valid configuration, use New instead.
func New ¶
New returns an initialized server to handle requests from Amazon API Gateway. The given media types slice may be nil, if Amazon API Gateway Binary support is not enabled. Otherwise, it should be an array of supported media types as configured in Amazon API Gateway.
func (*Server) Handle ¶
Handle responds to an AWS Lambda proxy function invocation via Amazon API Gateway. It transforms the Amazon API Gateway Proxy event to a standard HTTP request suitable for the Go net/http package. Then, it submits the data to the network listener so that it can be consumed by HTTP handler. Finally, it waits for the network listener to return response from handler and transmits it back to Amazon API Gateway.