Documentation ¶
Index ¶
- func JSONResponse(c echo.Context, statusCode int, body ResponseMap) error
- func JSONResponseArray(c echo.Context, statusCode int, collection []ResponseMap) error
- func JSONResponseError(c echo.Context, err *ResponseError) error
- func JSONResponseObject(c echo.Context, statusCode int, object Responsible) error
- type Errors
- func (errors *Errors) Add(field string, message string)
- func (errors *Errors) Clear()
- func (errors *Errors) HasMessages() bool
- func (errors *Errors) ValidateMaxValue(value int, maxValueAllowed int, field string, message string)
- func (errors *Errors) ValidateMinValue(value int, minValueAllowed int, field string, message string)
- type ResponseError
- type ResponseMap
- type Responsible
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func JSONResponse ¶
func JSONResponse(c echo.Context, statusCode int, body ResponseMap) error
func JSONResponseArray ¶
func JSONResponseArray(c echo.Context, statusCode int, collection []ResponseMap) error
func JSONResponseError ¶
func JSONResponseError(c echo.Context, err *ResponseError) error
func JSONResponseObject ¶
func JSONResponseObject(c echo.Context, statusCode int, object Responsible) error
Types ¶
type Errors ¶
Errors keep a record of the validation errors
func (*Errors) HasMessages ¶
HasMessages returns true if the estructure is not empty.
type ResponseError ¶
func NewResponseError ¶
func NewResponseError(httpCode int, message string) *ResponseError
func (*ResponseError) Error ¶
func (err *ResponseError) Error() string
type ResponseMap ¶
type ResponseMap map[string]interface{}
type Responsible ¶
type Responsible interface {
ToResponseMap() ResponseMap
}
Click to show internal directories.
Click to hide internal directories.