joeybloggs
24c1c6819f
Add nostructlevel tag
...
* nostructlevel - Same as structonly tag except that any struct level
validations will not run.
9 years ago
joeybloggs
59859969c6
Fix issue with structOnly + struct level validation
...
* Issue was that when "structonly" tag was set the struct
level validation wasn't running, this has been corrected.
9 years ago
joeybloggs
29403404e4
Added Helper method to Report errors from struct level.
9 years ago
joeybloggs
f1acffdfe0
Add Struct Level Validation!
9 years ago
joeybloggs
1570c9b6b3
Update Error message quotes to single quotes
...
* helps reduce noise when transmitting errors via JSON.
for #199
9 years ago
joeybloggs
fc5d9f3ae0
Exposed Baked In Validators
...
* Exposed for use within custom functions.
9 years ago
joeybloggs
3cef97a452
minor speed improvements
...
* added check for "-" in custom field name
9 years ago
İlker Göktuğ Öztürk
5bc0ff91f8
configurable field name support
9 years ago
joeybloggs
830d270923
Expose Methods for Custom functions
...
Exposed previously unexposed functions for use within custom functions.
* ExtractType
* GetStructFieldOK
9 years ago
joeybloggs
14df416126
Update Validator instance check
...
* change for one validator instance method and message
9 years ago
Joel Williams
715aa553c8
Added checking for nil receiver on Validator methods
9 years ago
joeybloggs
b2d8b4186c
update more comments
9 years ago
joeybloggs
9990e055a3
update comments
9 years ago
joeybloggs
0b51279b05
Update Error Pool
...
* made error pool per validator instance to reduce contention is
multiple validators are in play.
9 years ago
joeybloggs
70cb087d5a
update how config is passed in and assigned to validator
...
* makes it safer as options passed in by reference, in the future, will
not be manipulatable externally.
9 years ago
joeybloggs
10cf645b91
reorganization of code + variables to more appropriate structs
9 years ago
joeybloggs
9988ba3f45
update New to use register functions to avoid errors
9 years ago
joeybloggs
4807bf93bb
unexpose baked in validators map for safety.
9 years ago
joeybloggs
c293315337
updated tag caching for maximum performance
9 years ago
joeybloggs
b4563c2cf6
Add alias docs + notes
9 years ago
joeybloggs
a964f5384a
Completed 100% test coverage for alis registration
9 years ago
joeybloggs
407aac458f
Update Alias logic
...
- Unexport Alias Map in order to preserve any custom user aliases that
may conflict with new aliases added to the library itself....need to
copy them for each new validator.
- update error to report alias tag as the error tag and add actualTag to
know what it would have actually been.
9 years ago
joeybloggs
2cda50fb41
Add Tag Alias + basic tests
...
so far so good
9 years ago
joeybloggs
14b90946b3
Backport v7 updates
...
backporting v7 updates for the near released v7.
9 years ago
joeybloggs
883731a774
Updates + Benchmarks
...
update documentation.
add benchmarks for StructPartial, dive tag, cross field and cross struct cross field.
9 years ago
joeybloggs
4f46e02133
Add documentation for cross struct validation tags + Struct Partials
9 years ago
joeybloggs
387cfe5aa9
Complete adding StructPartial and StructExcept
...
for issue-#149
9 years ago
joeybloggs
8ae139a445
Partially Merged in Partial struct methods + Tests
9 years ago
joeybloggs
2fe52ca08f
finish eqcsfield + test coverage
9 years ago
joeybloggs
d19088f865
Code Cleanup + some renaming
9 years ago
joeybloggs
3ab458c80c
Updates
...
Split out Type checking.
Add Cross Field determination function for future automatic cross struct
namespace field validation.
9 years ago
joeybloggs
50f0798342
Run gofmt -s -w . on code
...
code cleanup, only a few changes.
9 years ago
joeybloggs
7e97fcf2c4
Add exists tag
...
exists tag used to ensure that a Pointer, Interface or
Invalid has a value, but won't interfere with any other validation.
9 years ago
joeybloggs
d2ea21ad15
Add RegisterCustomTypeFunc for easier adding of CustomTypeFunc
...
Thanks @johnniedoe for ths pull request!
9 years ago
Kevin Harrington
7c844893e1
Added RegisterCustomTypeFunc method and usage example.
9 years ago
joeybloggs
d363ed316c
Add handling of custom types
...
can add custom type handling, example: sql driver Valuer
can override any base data type like string or int ( I'd be carefull about that, but you can )
9 years ago
joeybloggs
e078205c78
Update Required & Invalid logic
...
updated required validator to check for a nil value for types:
slice, map, pointer, interface, channel and function.
updated tranverseField to handle invalid field type.
Changes to be committed:
modified: baked_in.go
modified: doc.go
modified: validator.go
modified: validator_test.go
9 years ago
joeybloggs
cdc48b4f90
Fix Bug in Ptr tests
9 years ago
joeybloggs
2baa4bd353
Minor code cleanup
9 years ago
joeybloggs
41b4a43989
Updated documentation for new v6
9 years ago
joeybloggs
e005b06f11
Add Field Tag caching
...
now the benchmarks are getting back to awesome!
9 years ago
joeybloggs
e2a5b9881e
Add ValidationErrs Caching
...
when no errors occur, let's reuse the existing object.
9 years ago
joeybloggs
7f4b49c751
Finished Tests, now at 100% test converage!
9 years ago
joeybloggs
4ce39526f6
Update Test Case + fix errors
...
Updated all tests to comply with new api.
Fix a few bugs found with validation.
9 years ago
joeybloggs
24d46304a8
Updating & re-injecting tests
...
updating test for the new error return formet
updated assertion functions to handle a nil Map,Slice,Ptr.....type
fixed hasValue check not comparing Interface but field Value.
9 years ago
joeybloggs
88cc19b9e1
Add traverseMap function
9 years ago
joeybloggs
4d2ffbedfc
Added traverseSlice function
9 years ago
joeybloggs
019c5fc4ac
Finished converting baked in functions & some updates
...
completed all validations function conversion.
updated omitempty check to continue if all ok instead of
passing tag to be validated.
9 years ago
joeybloggs
68ba87af24
More Progess
...
added single field validation function.
updated a few more baked in functions.
added back single field validation benchmark.
9 years ago
joeybloggs
7af3fb7c1f
initial validation logic reworked
...
initial function layouts and validation completed, still need to rework
all of the baked in functions, add map and array traversal and add back original
test cases.
NOTE: a far more pragmatic validation tests will be added, but not until it has
been proven stable with at least the old tests.
9 years ago