Documentation ¶
Overview ¶
Package restx contains utils for rest handlers.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetIDFromURLParams ¶
GetIDFromURLParams return id as an int64 from get params by its name.
func GetPaginationParams ¶
func GetPaginationParams(r *http.Request) (*paging.Pagination, error)
GetPaginationParams parses request pagination parameters.
func HandleError ¶
func HandleError(w http.ResponseWriter, r *http.Request, err error)
HandleError return in response the rendered error.
Types ¶
type ErrorResponse ¶
ErrorResponse is error struct for response.
func (ErrorResponse) Render ¶
func (e ErrorResponse) Render(w http.ResponseWriter, r *http.Request) error
Render http error response.
Click to show internal directories.
Click to hide internal directories.