Documentation ¶
Index ¶
- func DetailedJsonError(err error) error
- func JSON(w http.ResponseWriter, rsp *Response, headers map[string]string)
- func ParseBody(c *fiber.Ctx, payload any) error
- type Response
- func BadRequest(msg string, errorCode *string) *Response
- func Conflict(msg string, errorCode *string) *Response
- func Created(msg string, data any) *Response
- func Forbidden(msg string, errorCode *string) *Response
- func InternalServerError(msg string, errorCode *string) *Response
- func NewError(statusCode int, msg string, errorCode *string) *Response
- func NewSuccess(statusCode int, msg string, data any) *Response
- func NotFound(msg string, errorCode *string) *Response
- func Ok(msg string, data any) *Response
- func Unauthorized(msg string, errorCode *string) *Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DetailedJsonError ¶
DetailedJsonError checks the type of json Error
Types ¶
type Response ¶
type Response struct { StatusCode int `json:"-"` Success bool `json:"success"` Message string `json:"message"` ErrorCode *string `json:"errorCode,omitempty"` Data any `json:"data,omitempty"` RuntimeCallerInfo string `json:"-"` }
Response is the response structure.
func BadRequest ¶
func InternalServerError ¶
func Unauthorized ¶
Click to show internal directories.
Click to hide internal directories.