Ramy Aboul Naga
cbd5cf6393
Use type switch in favor of fmt.Sprint
6 years ago
Ramy Aboul Naga
52ea448998
Allow latitude/longitude validation for numeric values
6 years ago
franklin
91d81934ab
Add baked in validators for containsfield and excludesfield ( #424 )
...
* Add baked in validators for containsfield and excludesfield
* Add ContainsAndExcludes test
* Add NotEqual tests before AssertError
* Add tests for missing fields
* containsfield -> fieldcontains, excludesfield -> fieldexcludes
6 years ago
Leonardo Di Donato
0482874b86
Update: Rename urn tag into urn_rfc2141
...
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
6 years ago
Leonardo Di Donato
c5423e4116
New: URN
...
Signed-off-by: Leonardo Di Donato <leodidonato@gmail.com>
6 years ago
heatwole
0a9b75fbfd
Adding html and url encoding and updating docs
6 years ago
Noi Bar
f2fdb60d7d
Add file path validation
6 years ago
Dean Karn
ffe836d736
Expanded numeric & number validations
...
It was originally intended for these to only be used on strings, however
it makes sense to also use them if your dealing with type interface{}
so now ints and floats return true for this validation also as they are
both numeric and numbers.
closes #356
7 years ago
Dean Karn
54da7fa48f
fix linting and spelling errors
7 years ago
James Service
d978a4b421
Undo whitespace changes from gofmt.
7 years ago
James Service
8ae3903dd3
Extend the unique tag to also cover map values.
7 years ago
josh
073682ea75
added in more test cases and removed some redundant validation steps
7 years ago
josh
ce6284a6fc
confirm only all upper or all lower case address are valid
7 years ago
josh
6deddf27eb
proper bech32 address validation
7 years ago
josh
3df85bdcfc
p2sh validation and more tests
7 years ago
josh
60417282a4
verifies p2pkh addresses
7 years ago
josh
36d83b0b83
Added in validation function, tests, and docs
7 years ago
Kyriakos Georgiou
030800a855
Add validation for base64 URL safe values
7 years ago
Russ Egan
2e9adc3329
swapped mutex for rwmutex
...
similiar single-goroutine performance, slightly better concurrent performance.
7 years ago
Russ Egan
15217303f9
Add oneof validation
...
Validates that a string or number value equals one of a set of allowed values. Examples:
validator.Var(“red”, “oneof=red green”)
validator.Var(6, “oneof=6 7 8”)
7 years ago
Dean Karn
5e036656b8
Add hostname_rfc1123 validation
7 years ago
Dean Karn
61caf9d303
add map key validation support ( #324 )
7 years ago
Dean Karn
11a1fab51d
Add unique validation
7 years ago
Dean Karn
f16354ec03
Add isdefault + fix fqdn
...
Closes #299
Fixes #306
7 years ago
Aaron Lehmann
770163b1e1
Documentation fixes
...
This fixes a few documentation issues I noticed.
- Explain what Func is supposed to return.
- Remove change reference to ActualNamespace to mention StructNamespace
instead.
- Remove references to Validatable, which no longer exists.
- Fix godoc formatting.
- Delete extra text from ReportValidationErrors comment.
- Change ReportError interface definition so its arguments are named
consistently with what they do.
7 years ago
Dean Karn
0b5dc7605b
Add isdefault validation
7 years ago
Bruno Lorenz
dbd50b343f
Code hygiene
...
- Minor performance improve for FQDN validation
- Fix typo in documentation
- Simplified hostname regex
7 years ago
Bruno Lorenz
1669b6e0ee
Fixed "Assignment Branch Condition too high"
7 years ago
Bruno Lorenz
08796346a0
Append new validations
...
- hostname
- fqdn
7 years ago
Dean Karn
0f6f568263
Add contextual validation support via context.Context ( #296 )
...
* Add contextual validation support via context.Context
Added:
- RegisterValidationCtx
- RegisterStructValidationCtx
- StructCtx
- StructFilteredCtx
- StructPartialCtx
- StructExceptCtx
- VarCtx
- VarWithValueCtx
7 years ago
Dean Karn
4d76b0dd81
Add alphaunicode & aplhanumericunicode
...
- added unicode variants of alpha & alphanumeric
8 years ago
Dean Karn
493dfb6209
correct required tag functionality for pointers, now works like old `exists` tag.
8 years ago
joeybloggs
e0e1af6a61
working instance
8 years ago
joeybloggs
77f59a0ea0
corrected some spelling mistakes in documentation
8 years ago
joeybloggs
3ef55a89aa
fix some needed Type() calls.
8 years ago
joeybloggs
cdfcf16a86
fix some minor listing.
8 years ago
joeybloggs
e7749ea250
Update validations for "url" and "uri" because of Go 1.6 changes
...
added checks for blank and fragment/suffix because of Go 1.6 change 617c93ce74 (diff-6c2d018290e298803c0c9419d8739885L195)
fix was to emulate browser and strip the '#' suffix prior to validation. see #237
9 years ago
joeybloggs
93bb347253
Update validations for "url" and "uri" because of Go 1.6 changes
...
added checks for blank and fragment/suffix because of Go 1.6 change 617c93ce74 (diff-6c2d018290e298803c0c9419d8739885L195)
fix was to emulate browser and strip the '#' suffix prior to validation. see #237
9 years ago
joeybloggs
6851add4e4
Update to avoid double resolves
9 years ago
joeybloggs
4cb9152af0
correct IsUPDAddrResolvable functions
9 years ago
joeybloggs
faf40fd62f
Correct validation for TCPAddrResolvable
9 years ago
joeybloggs
7b758151c6
Add workaround for go issue
9 years ago
Hubert Krauze
def24ae611
Add Resolvable suffix to functions so they can be more meaningful
9 years ago
Hubert Krauze
5a99cf6052
Add validation functions for tcp/udp/ip/unix addresses
9 years ago
joeybloggs
0862513fbf
Add some string check optimizations
...
* was using len(string) for some blank checks instead of string == ""
9 years ago
joeybloggs
fc5d9f3ae0
Exposed Baked In Validators
...
* Exposed for use within custom functions.
9 years ago
Hubert
9ffc753204
add cidr, cidrv4 and cidrv6 validators
...
- add validate functions
- add tests
- put validators as builtin in docs
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
8119861695
inline Regex calls
9 years ago
joeybloggs
10cf645b91
reorganization of code + variables to more appropriate structs
9 years ago