Documentation ¶
Overview ¶
Package validate contains the support for validating models.
Index ¶
- func Check(val any) error
- func CheckConfig(key, value string) error
- func CheckEmail(email string) bool
- func CheckID(id string) error
- func CheckPostCmds(postCmds string) error
- func CheckSplitRule(splitRule string) error
- func GenerateID() string
- func IsFieldErrors(err error) bool
- type FieldError
- type FieldErrors
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckConfig ¶
CheckConfig validates that the Config format is valid.
func CheckEmail ¶
CheckEmail validates that the string is an email.
func CheckPostCmds ¶
CheckPostCmds validates that the PostCmds format is valid.
func CheckSplitRule ¶
CheckSplitRule validates that the SplitRule format is valid.
func IsFieldErrors ¶
IsFieldErrors checks if an error of type FieldErrors exists.
Types ¶
type FieldError ¶
FieldError is used to indicate an error with a specific request field.
type FieldErrors ¶
type FieldErrors []FieldError
FieldErrors represents a collection of field errors.
func GetFieldErrors ¶
func GetFieldErrors(err error) FieldErrors
GetFieldErrors returns a copy of the FieldErrors pointer.
func (FieldErrors) Error ¶
func (fe FieldErrors) Error() string
Error implements the error interface.
func (FieldErrors) Fields ¶
func (fe FieldErrors) Fields() map[string]string
Fields returns the fields that failed validation
Click to show internal directories.
Click to hide internal directories.