Documentation ¶
Index ¶
- func DecodeJSONBody(w http.ResponseWriter, r *http.Request, dst interface{}) errors.ErouskaError
- func DecodeJSONOrReportError(w http.ResponseWriter, r *http.Request, dst interface{}) bool
- func SendEmptyResponse(w http.ResponseWriter, r *http.Request)
- func SendErrorResponse(w http.ResponseWriter, r *http.Request, err error)
- func SendResponse(w http.ResponseWriter, r *http.Request, response interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeJSONBody ¶
func DecodeJSONBody(w http.ResponseWriter, r *http.Request, dst interface{}) errors.ErouskaError
DecodeJSONBody Decode request body from JSON to struct copied from https://www.alexedwards.net/blog/how-to-properly-parse-a-json-request-body
func DecodeJSONOrReportError ¶
func DecodeJSONOrReportError(w http.ResponseWriter, r *http.Request, dst interface{}) bool
DecodeJSONOrReportError Decodes request JSON and writes possible errors to the ResponseWriter. Return bool - if the request was decoded successfully.
func SendEmptyResponse ¶
func SendEmptyResponse(w http.ResponseWriter, r *http.Request)
SendEmptyResponse Marshals empty response into JSON and sends it to the client.
func SendErrorResponse ¶
func SendErrorResponse(w http.ResponseWriter, r *http.Request, err error)
SendErrorResponse Sends error response as required by Firebase SDK.
func SendResponse ¶
func SendResponse(w http.ResponseWriter, r *http.Request, response interface{})
SendResponse Marshals response into JSON and sends it to the client.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.