Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MovieController ¶
func MovieController(h handlers.MovieHandler, r *mux.Router)
MovieController instantiates a movie controller.
func ServerResponse ¶
func ServerResponse(w http.ResponseWriter, r *http.Request, hr handlers.HandlerResponse)
ServerResponse builds a HTTP response based on a handler response.
Types ¶
type BaseErrorResponse ¶
type BaseErrorResponse struct { Error string `json:"error"` Message string `json:"message"` Path string `json:"path"` Timestamp time.Time `json:"timestamp"` }
BaseErrorResponse structure.
func ResourceNotFound ¶
func ResourceNotFound(path string, message string) BaseErrorResponse
ResourceNotFound builds and returns a server response object for a resource not found error.
type ValidationErrorResponse ¶
type ValidationErrorResponse struct { Message string `json:"message"` FieldErrors []common.FieldError `json:"fieldErrors"` Path string `json:"path"` Timestamp time.Time `json:"timestamp"` }
ValidationErrorResponse structure.
func ValidationError ¶
func ValidationError(path string, fieldErrors []common.FieldError) ValidationErrorResponse
ValidationError builds and returns a server response object for a validation error.
Click to show internal directories.
Click to hide internal directories.