Documentation ¶
Index ¶
- func ContainsCategory(categories []*models.Category, category *models.Category) bool
- func FormIntValue(r *http.Request, name string) (int, error)
- func GetPaginationValues(r *http.Request) dto.Pagination
- func HttpCatch(w http.ResponseWriter, status int, err error)
- func MustCatch(err error)
- func Respond(w http.ResponseWriter, r Response)
- func ResponseErrors(w http.ResponseWriter, errs []error)
- func ValidateStruct(obj interface{}) (errs []error)
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainsCategory ¶
func FormIntValue ¶
FormIntValue parse form value to integer type.
func GetPaginationValues ¶
func GetPaginationValues(r *http.Request) dto.Pagination
GetPaginationValues helpers will parse URL query and return dto.Pagination data.
func Respond ¶
func Respond(w http.ResponseWriter, r Response)
func ResponseErrors ¶
func ResponseErrors(w http.ResponseWriter, errs []error)
ResponseErrors utility to return validation errors as JSON
func ValidateStruct ¶
func ValidateStruct(obj interface{}) (errs []error)
Types ¶
Click to show internal directories.
Click to hide internal directories.