http

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 19, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL