Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ErrorResponse ¶ added in v1.2.1
ErrorResponse maps the given error to an appropriate HTTP error response.
If the error is an *model.AppError, it extracts the error code and optional data. Otherwise, it falls back to mapping the error's message string through the error_code package.
@Failure 4xx/5xx {object} model.BaseResponse
func Response ¶
Response is a convenience helper that dispatches to SuccessResponseWithData or ErrorResponse based on whether err is nil.
Usage:
func GetUser(c echo.Context) error {
user, err := service.GetUser(id)
return response.Response(c, user, err)
}
func SuccessResponse ¶ added in v1.2.1
SuccessResponse returns HTTP 200 with a success response without data.
@Success 200 {object} model.BaseResponse
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.