Documentation
¶
Index ¶
- func BadRequest(c echo.Context, message string) error
- func Created(c echo.Context, data any) error
- func Forbidden(c echo.Context, message string) error
- func InternalError(c echo.Context, message string) error
- func JSON(c echo.Context, status int, data any) error
- func JSONCreated(c echo.Context, message string) error
- func JSONError(c echo.Context, status int, message string) error
- func JSONForbidden(c echo.Context, message string) error
- func JSONNotFound(c echo.Context, message string) error
- func JSONSuccess(c echo.Context, message string) error
- func JSONUnauthorized(c echo.Context, message string) error
- func NotFound(c echo.Context, message string) error
- func Success(c echo.Context, data any) error
- func Unauthorized(c echo.Context, message string) error
- type MapResponse
- type Response
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BadRequest ¶
BadRequest sends a 400 response with error message
func InternalError ¶
InternalError sends a 500 response with error message
func JSONCreated ¶
JSONCreated sends a JSON created response
func JSONForbidden ¶
JSONForbidden sends a JSON forbidden response
func JSONNotFound ¶
JSONNotFound sends a JSON not found response
func JSONSuccess ¶
JSONSuccess sends a JSON success response
func JSONUnauthorized ¶
JSONUnauthorized sends a JSON unauthorized response
Types ¶
type MapResponse ¶
MapResponse represents a map response
func NewMapResponse ¶
func NewMapResponse(data map[string]any) *MapResponse
NewMapResponse creates a new map response
type Response ¶
type Response struct {
Status string `json:"status"`
Message string `json:"message,omitempty"`
Data any `json:"data,omitempty"`
// contains filtered or unexported fields
}
Response represents the standard API response format
Click to show internal directories.
Click to hide internal directories.