Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Application ¶
func Application(cfg *config.Config) interfaces.Application
Application func, initialize the App
Types ¶
type LambdaResponder ¶
LambdaResponder managing lambda response
func (*LambdaResponder) Handler ¶
func (a *LambdaResponder) Handler(req events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error)
Handler for lambda
func (*LambdaResponder) ProxyEventToHTTPRequest ¶
func (a *LambdaResponder) ProxyEventToHTTPRequest(req events.APIGatewayProxyRequest) (*http.Request, error)
ProxyEventToHTTPRequest proxy to event handler
type ProxyResponseWriter ¶
type ProxyResponseWriter struct { Headers http.Header `json:"headers"` Body []byte `json:"body"` Status int `json:"statusCode"` }
ProxyResponseWriter implements http.ResponseWriter and adds the method necessary to return an events.APIGatewayProxyResponse object
func NewProxyResponseWriter ¶
func NewProxyResponseWriter() *ProxyResponseWriter
NewProxyResponseWriter returns a new ProxyResponseWriter object. The object is initialized with an empty map of headers and a status code of -1
func (*ProxyResponseWriter) GetProxyResponse ¶
func (r *ProxyResponseWriter) GetProxyResponse() (events.APIGatewayProxyResponse, error)
GetProxyResponse converts the data passed to the response writer into an events.APIGatewayProxyResponse object. Returns a populated proxy response object. If the reponse is invalid, for example has no headers or an invalid status code returns an error.
func (*ProxyResponseWriter) Header ¶
func (r *ProxyResponseWriter) Header() http.Header
Header implementation from the http.ResponseWriter interface.
func (*ProxyResponseWriter) Write ¶
func (r *ProxyResponseWriter) 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 (*ProxyResponseWriter) WriteHeader ¶
func (r *ProxyResponseWriter) WriteHeader(status int)
WriteHeader sets a status code for the response. This method is used for error responses.