Documentation ¶
Index ¶
- func BadRequest(c *gin.Context, errors ...Error)
- func CannotBind(c *gin.Context, err error)
- func Conflict(c *gin.Context, errors ...Error)
- func Created(c *gin.Context, data interface{})
- func Forbidden(c *gin.Context, errors ...Error)
- func FromError(c *gin.Context, err error)
- func InternalError(c *gin.Context, errors ...Error)
- func NotFound(c *gin.Context, errors ...Error)
- func Ok(c *gin.Context, data interface{})
- func OkWithMeta(c *gin.Context, data interface{}, metadata interface{})
- func Timeout(c *gin.Context)
- func Unauthorized(c *gin.Context, errors ...Error)
- func Unavailable(c *gin.Context, errors ...Error)
- type Error
- type ErrorResponse
- type SuccessResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BadRequest ¶
BadRequest sets the HTTP response status to 400
func CannotBind ¶
CannotBind sets the HTTP response status to 400
func InternalError ¶
InternalError sets the HTTP response status to 500
func OkWithMeta ¶
OkWithMeta sets the HTTP response status to 200
func Unauthorized ¶
Unauthorized sets the HTTP response status to 401
func Unavailable ¶
Unavailable sets the HTTP response status to 503
Types ¶
type Error ¶
type ErrorResponse ¶
type SuccessResponse ¶
type SuccessResponse struct {
Data interface{} `json:"data"`
}
Click to show internal directories.
Click to hide internal directories.