Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterValidator ¶
This allows you to register custom validator to be read from struct field tag validatoin data.
Types ¶
type ValidationError ¶
type ValidationError struct {
DataType string
Errors validationErrorMap
}
func Validate ¶
func Validate(v *validationparams.ValidationParams) (*ValidationError, error)
Thinking of building validation code to read tags. The Validator parameter is present to allow for validating non struct values. In this function A *Validator can be passed in and evaluated on a non struct value like an individual int or string TODO: Validate nested structs and arrays.
func ValidateStructWithTag ¶
func ValidateStructWithTag(s interface{}) *ValidationError
This function valudates an input struct based on the validation tags is has in its tag data.
func (*ValidationError) Error ¶
func (e *ValidationError) Error() string
Click to show internal directories.
Click to hide internal directories.