Documentation ¶
Index ¶
- func ContentTypeValidator(response http.ResponseWriter, request *http.Request)
- func IsNilFixed(i interface{}) bool
- func MaxRequestValidator(response http.ResponseWriter, request *http.Request) *json.Decoder
- func PostPatchRequestValidator(response http.ResponseWriter, request *http.Request, err error) bool
- func SingleJsonValidator(response http.ResponseWriter, request *http.Request, err error) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContentTypeValidator ¶
func ContentTypeValidator(response http.ResponseWriter, request *http.Request)
ContentTypeValidator checks for content type existence and check for json validity
func IsNilFixed ¶
func IsNilFixed(i interface{}) bool
func MaxRequestValidator ¶
MaxRequestValidator uses http.MaxBytesReader to enforce a maximum read of 1MB .
func PostPatchRequestValidator ¶
PostPatchRequestValidator for creating menus
func SingleJsonValidator ¶
SingleJsonValidator calls decode again, using a pointer to an empty anonymous struct as the destination. If the request body only contained a single JSON object this will return an io.EOF error. So if we get anything else, we know that there is additional data in the request body.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.