web

package
v1.0.13-WIP003 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RespondError

func RespondError(w http.ResponseWriter, err error)

RespondError returns a validation error else

func RespondErrorMessage

func RespondErrorMessage(w http.ResponseWriter, code int, message string)

RespondErrorMessage makes the error response with payload as json format

func RespondJSON

func RespondJSON(w http.ResponseWriter, status int, payload interface{})

RespondJSON makes the response with payload as json format

func RespondJSONWithXTotalCount added in v0.0.90

func RespondJSONWithXTotalCount(w http.ResponseWriter, status int, count int, payload interface{})

RespondJSONWithXTotalCount makes the response with payload as json format and adds X-Total-Count header

func UnmarshalJSON

func UnmarshalJSON(r *http.Request, target interface{}) error

UnmarshalJSON checks for empty body and then parses JSON into the target

Types

This section is empty.

Jump to

Keyboard shortcuts

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