Documentation ¶
Index ¶
- Constants
- Variables
- func BindAndValidateRequest(c echo.Context, req Validatable) bool
- func ErrorResponse(c echo.Context, status string) error
- func NotFoundResponse(c echo.Context, message string) error
- func QueryLimit(c echo.Context) (int, error)
- func QueryReverseOrder(c echo.Context) (bool, error)
- func UUID(c echo.Context, param string) (uuid.UUID, error)
- func ValidationErrorItemResponse(c echo.Context, field, message string, args ...any) error
- func ValidationErrorResponse(c echo.Context, reason any) error
- func WrapErrorItem(item *model.ErrorResponseItem) error
- type PaginationQuery
- type Validatable
Constants ¶
View Source
const ( ParamQueryLimit = "limit" ParamQueryCursor = "cursor" ParamQueryReserveOrder = "reverseOrder" )
View Source
const StatusInternalError = "internal_error"
Variables ¶
View Source
var ( ErrLimitInvalid = errors.New("invalid limit") ErrReverseOrderInvalid = errors.New("invalid reverseOrder") )
Functions ¶
func BindAndValidateRequest ¶
func BindAndValidateRequest(c echo.Context, req Validatable) bool
func ErrorResponse ¶
func NotFoundResponse ¶
func QueryLimit ¶
func QueryReverseOrder ¶
func UUID ¶
UUID parsed uuid from request's path or query. If failed, writes validation error response.
func ValidationErrorResponse ¶
func WrapErrorItem ¶
func WrapErrorItem(item *model.ErrorResponseItem) error
Types ¶
type PaginationQuery ¶
func QueryPagination ¶
func QueryPagination(c echo.Context) (PaginationQuery, error)
type Validatable ¶
Click to show internal directories.
Click to hide internal directories.