Documentation ¶
Index ¶
- func NotFound(ctx *gin.Context)
- func RedirectToLogin(ctx *gin.Context, dst string)
- func Send(ctx *gin.Context, statusCode int, data interface{})
- func SendError(ctx *gin.Context, statusCode int, data interface{})
- func SendErrorWithParams(ctx *gin.Context, statusCode int, data interface{}, ...)
- func SendFile(c *gin.Context, storageDomain model.StorageDomain, path string)
- func SendInternalServerError(ctx *gin.Context)
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RedirectToLogin ¶
SendNotFound directly sends a not found response
func SendErrorWithParams ¶
func SendErrorWithParams(ctx *gin.Context, statusCode int, data interface{}, errorParams map[string]string)
SendErrorWithParams the same as above but for errors that require error parameters
func SendFile ¶
func SendFile(c *gin.Context, storageDomain model.StorageDomain, path string)
SendFile sends file to client with caching header
func SendInternalServerError ¶
SendInternalServerError directly sends an internal server error response
Types ¶
type Response ¶
type Response struct { // Response payload // Ok if the response was successful or not Ok bool `json:"ok"` // Message the payload of the response, depending on the endpoint/response status Message any `json:"message"` // ErrorParams parameters defined if the response is not successful to help client's debugging ErrorParams map[string]string `json:"error_params,omitempty"` // contains filtered or unexported fields }
func NewResponse ¶
func (*Response) GetMessage ¶ added in v1.6.3
Click to show internal directories.
Click to hide internal directories.