Documentation
¶
Overview ¶
This package helps in forming common Response and Errors
Index ¶
- func Error(opts ErrorOptions)
- func Errors(opts ErrorOptions)
- func IsValidationError(err error) (validation.ValidationErrors, bool)
- func Json(w http.ResponseWriter, statusCode int, data any, logger *zerolog.Logger)
- func Response(w http.ResponseWriter, r *http.Request, statusCode int, messageKey string, ...)
- func Status(w http.ResponseWriter, statusCode int)
- type ErrorOptions
- type ErrorResponse
- type SuccessResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Errors ¶
func Errors(opts ErrorOptions)
Handle sending multiple error (mostly used for validation)
func IsValidationError ¶
func IsValidationError(err error) (validation.ValidationErrors, bool)
IsValidationError checks if the error is a validation error
func Status ¶
func Status(w http.ResponseWriter, statusCode int)
Status responds with just a status code
Types ¶
type ErrorOptions ¶
type ErrorResponse ¶
type SuccessResponse ¶
Click to show internal directories.
Click to hide internal directories.