Commit graph

88 commits

Author SHA1 Message Date
joeybloggs
883731a774 Updates + Benchmarks
update documentation.
add benchmarks for StructPartial, dive tag, cross field and cross struct cross field.
2015-08-18 22:10:26 -04:00
joeybloggs
4f46e02133 Add documentation for cross struct validation tags + Struct Partials 2015-08-18 21:10:40 -04:00
joeybloggs
387cfe5aa9 Complete adding StructPartial and StructExcept
for issue-#149
2015-08-17 13:18:28 -04:00
joeybloggs
8ae139a445 Partially Merged in Partial struct methods + Tests 2015-08-17 07:37:05 -04:00
joeybloggs
2fe52ca08f finish eqcsfield + test coverage 2015-08-14 21:02:01 -04:00
joeybloggs
d19088f865 Code Cleanup + some renaming 2015-08-14 09:06:52 -04:00
joeybloggs
3ab458c80c Updates
Split out Type checking.
Add Cross Field determination function for future automatic cross struct
namespace field validation.
2015-08-13 23:47:19 -04:00
joeybloggs
50f0798342 Run gofmt -s -w . on code
code cleanup, only a few changes.
2015-08-03 22:53:08 -04:00
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.
2015-08-03 20:47:11 -04:00
joeybloggs
d2ea21ad15 Add RegisterCustomTypeFunc for easier adding of CustomTypeFunc
Thanks @johnniedoe for ths pull request!
2015-08-01 20:54:40 -04:00
Kevin Harrington
7c844893e1 Added RegisterCustomTypeFunc method and usage example. 2015-07-31 19:33:07 -04:00
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 )
2015-07-30 22:24:43 -04:00
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
2015-07-27 17:20:42 -04:00
joeybloggs
cdc48b4f90 Fix Bug in Ptr tests 2015-07-20 08:45:29 -04:00
joeybloggs
2baa4bd353 Minor code cleanup 2015-07-19 21:39:58 -04:00
joeybloggs
41b4a43989 Updated documentation for new v6 2015-07-19 10:48:16 -04:00
joeybloggs
e005b06f11 Add Field Tag caching
now the benchmarks are getting back to awesome!
2015-07-16 22:45:36 -04:00
joeybloggs
e2a5b9881e Add ValidationErrs Caching
when no errors occur, let's reuse the existing object.
2015-07-16 09:24:18 -04:00
joeybloggs
7f4b49c751 Finished Tests, now at 100% test converage! 2015-07-16 08:20:20 -04:00
joeybloggs
4ce39526f6 Update Test Case + fix errors
Updated all tests to comply with new api.
Fix a few bugs found with validation.
2015-07-15 23:29:31 -04:00
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.
2015-07-15 09:30:07 -04:00
joeybloggs
88cc19b9e1 Add traverseMap function 2015-07-15 07:45:28 -04:00
joeybloggs
4d2ffbedfc Added traverseSlice function 2015-07-14 23:11:59 -04:00
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.
2015-07-14 22:45:37 -04:00
joeybloggs
68ba87af24 More Progess
added single field validation function.
updated a few more baked in functions.
added back single field validation benchmark.
2015-07-14 21:10:25 -04:00
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.
2015-07-14 13:36:55 -04:00
joeybloggs
9596b89a26 working on traversing field values
whether it's a struct field or just a regular field
working on a single function to handle both to reduce
checking the same values within struct field recursion or
a regular field; this will also help reduce code complexity
and keep things DRY.
2015-07-12 21:57:16 -04:00
joeybloggs
e42d7b683a determined variable values to be passed
for #74
2015-07-11 20:55:21 -04:00
joeybloggs
c62550c414 Investigating difference speed architectures
investigation if goroutines in a consumer producer pattern vs passing a map
Spoiler: the map wins out big time!
2015-07-10 11:31:53 -04:00
joeybloggs
e1fd32247f Fix interface issue when value is set but no validation tag exists 2015-07-09 14:06:48 -04:00
joeybloggs
562e77833a change to use native sync.Pool
for #98
2015-07-05 11:31:09 -04:00
joeybloggs
92bd6b335a code cleanup
for #88
2015-06-29 20:14:58 -04:00
joeybloggs
f604b6cc96 Complete Flatten logic
for #88
2015-06-29 20:10:13 -04:00
joeybloggs
4d57165562 fix wrong variable used in checking for "[" char
for #85
2015-06-29 09:53:08 -04:00
joeybloggs
7d55bfddde complete flatten logic for array elements
for #85
2015-06-29 09:48:57 -04:00
joeybloggs
c7ff296dca correct interface issue
add handling of interface validation by determining it's type

for issue #85
2015-06-28 21:51:39 -04:00
joeybloggs
200a5b4aad finish map error handling & complete test coverage
for #78
2015-06-27 13:41:33 -04:00
joeybloggs
8bf793acde correct map references pointing to slice after copy/paste
for#78
2015-06-27 08:22:37 -04:00
joeybloggs
14f176e8ac add traverseMap
for #78
2015-06-26 10:18:17 -04:00
joeybloggs
98f4165fae added time test
fix issue with time.Time data type validation
2015-06-26 09:57:02 -04:00
joeybloggs
a0f6d14ada add more tests
correct pointer issue is traverseArray

for #78
2015-06-26 08:41:37 -04:00
joeybloggs
689d3e9989 finalized array error handling
for #78
2015-06-26 07:47:12 -04:00
joeybloggs
1ba858eec1 correct FieldError error printing idea issue
for #78
2015-06-26 07:38:28 -04:00
joeybloggs
6eded1f817 correct error output and index out of order error
for #78
2015-06-26 07:28:15 -04:00
joeybloggs
d019d02290 Add some initial validation
change slice errors variable type to map[int]error to allow tracking of index of the error i the array

for #78
2015-06-25 17:24:25 -04:00
joeybloggs
4afdc19aef Finish initial array traversal logic
for #78
2015-06-25 09:15:46 -04:00
joeybloggs
a3cf2f5cf3 Merge branch 'v5-development' into add-array-slice-map-dive-support 2015-06-20 12:04:41 -04:00
joeybloggs
e0e86490bf Fix Issue with nested struct as pointer being nil
for #79
2015-06-20 11:56:16 -04:00
joeybloggs
e0bfa17b22 add initial dive logic 2015-06-20 10:04:55 -04:00
joeybloggs
9ff11ae808 break out benchmarks into separate file
create examples file for better godocs
2015-06-10 22:03:57 -04:00