Documentation ¶
Index ¶
- func EventToRequest(req events.LambdaFunctionURLRequest) (*http.Request, error)
- func New(handler http.Handler) ...
- type URLResponseWriter
- func (r *URLResponseWriter) CloseNotify() <-chan bool
- func (r *URLResponseWriter) GetProxyResponse() (events.LambdaFunctionURLResponse, error)
- func (r *URLResponseWriter) Header() http.Header
- func (r *URLResponseWriter) Write(body []byte) (int, error)
- func (r *URLResponseWriter) WriteHeader(status int)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EventToRequest ¶
func EventToRequest(req events.LambdaFunctionURLRequest) (*http.Request, error)
EventToRequest converts an API Gateway proxy event into an http.Request object. Returns the populated request maintaining headers
Types ¶
type URLResponseWriter ¶
type URLResponseWriter struct {
// contains filtered or unexported fields
}
URLResponseWriter implements http.ResponseWriter and adds the method necessary to return an events.APIGatewayProxyResponse object
func NewURLResponseWriter ¶
func NewURLResponseWriter() *URLResponseWriter
NewURLResponseWriter returns a new URLResponseWriter object. The object is initialized with an empty map of headers and a status code of -1
func (*URLResponseWriter) CloseNotify ¶
func (r *URLResponseWriter) CloseNotify() <-chan bool
func (*URLResponseWriter) GetProxyResponse ¶
func (r *URLResponseWriter) GetProxyResponse() (events.LambdaFunctionURLResponse, error)
GetProxyResponse converts the data passed to the response writer into an events.APIGatewayProxyResponse object. Returns a populated proxy response object. If the response is invalid, for example has no headers or an invalid status code returns an error.
func (*URLResponseWriter) Header ¶
func (r *URLResponseWriter) Header() http.Header
Header implementation from the http.ResponseWriter interface.
func (*URLResponseWriter) Write ¶
func (r *URLResponseWriter) Write(body []byte) (int, error)
Write sets the response body in the object. If no status code was set before with the WriteHeader method it sets the status for the response to 200 OK.
func (*URLResponseWriter) WriteHeader ¶
func (r *URLResponseWriter) WriteHeader(status int)
WriteHeader sets a status code for the response. This method is used for error responses.