Documentation ¶
Index ¶
- func GetLimitAndOffset(urlQuery url.Values) (_, _ int, extErr exterrors.ExtError)
- func ProcessRequestBody(w http.ResponseWriter, r *http.Request, body interface{}) error
- func SendExtError(w http.ResponseWriter, extError exterrors.ExtError)
- func SendExtErrors(w http.ResponseWriter, code int, httpErrors exterrors.ExtErrors)
- func SendRawResponse(w http.ResponseWriter, statusCode int, binBody []byte)
- func SendResponse(w http.ResponseWriter, statusCode int, respBody interface{})
- func UnmarshalRequestBody(r *http.Request, body interface{}) exterrors.ExtError
- func ValidateRequestBody(r *http.Request, body interface{}) exterrors.ExtErrors
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLimitAndOffset ¶
GetLimitAndOffset returns limit and offset from query parameters.
func ProcessRequestBody ¶
func ProcessRequestBody(w http.ResponseWriter, r *http.Request, body interface{}) error
ProcessRequestBody unmarshal and validate request body and sends errors if any.
func SendExtError ¶
func SendExtError(w http.ResponseWriter, extError exterrors.ExtError)
SendExtError sends extError with code selected based on the ErrorCode.
func SendExtErrors ¶
func SendExtErrors(w http.ResponseWriter, code int, httpErrors exterrors.ExtErrors)
SendExtError sends extErrors.
func SendRawResponse ¶
func SendRawResponse(w http.ResponseWriter, statusCode int, binBody []byte)
SendRawResponse sends any raw ([]byte) response.
func SendResponse ¶
func SendResponse(w http.ResponseWriter, statusCode int, respBody interface{})
SendResponse - encode response to json and send it.
func UnmarshalRequestBody ¶
UnmarshalRequestBody unmarshals request body.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.