Documentation ¶
Index ¶
- Variables
- func CreateMessageResponse(message string, statusCode int, c *fiber.Ctx) error
- func CreateResponse[T any](data *T, statusCode int, c *fiber.Ctx) error
- func MessageResponse(message string, statusCode int, c *fiber.Ctx) error
- type ErrorResponse
- func BadRequestError(message string) ErrorResponse
- func BadRequestErrorWithData(message string, data interface{}) ErrorResponse
- func ForbiddenError() ErrorResponse
- func InternalServerError(err error) ErrorResponse
- func NotFoundError(messages ...string) ErrorResponse
- func UnauthorizedError() ErrorResponse
- type Response
- type Result
Constants ¶
This section is empty.
Variables ¶
View Source
var ResponseStatus = struct { FailedResponse string SuccessResponse string RetryResponse string }{ FailedResponse: "FAILED", SuccessResponse: "OK", RetryResponse: "RETRY", }
Functions ¶
func CreateMessageResponse ¶
func CreateResponse ¶
func MessageResponse ¶
Types ¶
type ErrorResponse ¶
type ErrorResponse interface { Error() string GetMessage() string GetCode() int GetData() interface{} ToResponse(c *fiber.Ctx) error GetStack() string }
func BadRequestError ¶
func BadRequestError(message string) ErrorResponse
func BadRequestErrorWithData ¶
func BadRequestErrorWithData(message string, data interface{}) ErrorResponse
func ForbiddenError ¶
func ForbiddenError() ErrorResponse
func InternalServerError ¶
func InternalServerError(err error) ErrorResponse
func NotFoundError ¶
func NotFoundError(messages ...string) ErrorResponse
func UnauthorizedError ¶
func UnauthorizedError() ErrorResponse
Click to show internal directories.
Click to hide internal directories.