Documentation ¶
Index ¶
- func CurrentUser(r *http.Request) models.User
- func Err422(reason string, w http.ResponseWriter)
- func MarshalResponseBody(w http.ResponseWriter, status int, response interface{}) error
- func UnmarshalRequestBody(body io.Reader, object interface{}) error
- func ValidateStruct(unvalidated interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CurrentUser ¶
CurrentUser returns the user associated with the identity in the request context
func Err422 ¶
func Err422(reason string, w http.ResponseWriter)
Err422 writes an error in the standard format to the response body
func MarshalResponseBody ¶
func MarshalResponseBody(w http.ResponseWriter, status int, response interface{}) error
MarshalResponseBody json encodes and object to a response body and sets the status code
func UnmarshalRequestBody ¶
UnmarshalRequestBody decodes json from a request body into an object
func ValidateStruct ¶
func ValidateStruct(unvalidated interface{}) error
ValidateStruct uses validator library to validate a struct
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.