Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Field ¶
type Field vLib.FieldLevel
Field describes a field in a struct. It is used to get info about it for validation.
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
func NewValidator ¶
func NewValidator() *Validator
Our validator is setup only for 'en' locale. If we need to support other locales, we can add them here. But do not forget to add locales to the RegisterValidation too then.
func (*Validator) RegisterValidation ¶
RegisterValidation registers a new validation function with the validator. This function will be called when the validator encounters the tag.
func (*Validator) UnpackErrors ¶
UnpackErrors unpacks the error returned by ValidateStruct into a slice of strings.
Click to show internal directories.
Click to hide internal directories.