Documentation ¶
Index ¶
- Variables
- func ParseAndValidate(r *http.Request, v any) error
- func ParseBody(r *http.Request, v any) error
- func SendHTTPJSONError(w http.ResponseWriter, status int, err error)
- func SendJSON(w http.ResponseWriter, status int, p any)
- func SendValidationError(w http.ResponseWriter, err error, status int)
- func Validator() *validator.Validate
- type Payload
- type ValidationError
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrInvalidRequest = errors.New("invalid request body")
)
Functions ¶
func SendHTTPJSONError ¶
func SendHTTPJSONError(w http.ResponseWriter, status int, err error)
func SendValidationError ¶
func SendValidationError(w http.ResponseWriter, err error, status int)
Types ¶
type ValidationError ¶
type ValidationError struct {
Errors []string
}
func (ValidationError) Error ¶
func (e ValidationError) Error() string
Click to show internal directories.
Click to hide internal directories.