|
|
@ -197,6 +197,11 @@ Here is a list of the current built in validators: |
|
|
|
equal to the parameter given. For slices, arrays, and maps, |
|
|
|
equal to the parameter given. For slices, arrays, and maps, |
|
|
|
validates the number of items. (Usage: eq=10) |
|
|
|
validates the number of items. (Usage: eq=10) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ne |
|
|
|
|
|
|
|
For strings & numbers, eq will ensure that the value is not |
|
|
|
|
|
|
|
equal to the parameter given. For slices, arrays, and maps, |
|
|
|
|
|
|
|
validates the number of items. (Usage: eq=10) |
|
|
|
|
|
|
|
|
|
|
|
gt |
|
|
|
gt |
|
|
|
For numbers, this will ensure that the value is greater than the |
|
|
|
For numbers, this will ensure that the value is greater than the |
|
|
|
parameter given. For strings, it checks that the string length |
|
|
|
parameter given. For strings, it checks that the string length |
|
|
@ -233,6 +238,13 @@ Here is a list of the current built in validators: |
|
|
|
Validation on Password field using validate.Struct Usage(eqfield=ConfirmPassword) |
|
|
|
Validation on Password field using validate.Struct Usage(eqfield=ConfirmPassword) |
|
|
|
Validating by field validate.FieldWithValue(password, confirmpassword, "eqfield") |
|
|
|
Validating by field validate.FieldWithValue(password, confirmpassword, "eqfield") |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
nefield |
|
|
|
|
|
|
|
This will validate the field value against another fields value either within |
|
|
|
|
|
|
|
a struct or passed in field. |
|
|
|
|
|
|
|
usage examples are for ensuring two colors are not the same: |
|
|
|
|
|
|
|
Validation on Color field using validate.Struct Usage(nefield=Color2) |
|
|
|
|
|
|
|
Validating by field validate.FieldWithValue(color1, color2, "nefield") |
|
|
|
|
|
|
|
|
|
|
|
gtfield |
|
|
|
gtfield |
|
|
|
Only valid for Numbers and time.Time types, this will validate the field value |
|
|
|
Only valid for Numbers and time.Time types, this will validate the field value |
|
|
|
against another fields value either within a struct or passed in field. |
|
|
|
against another fields value either within a struct or passed in field. |
|
|
|