Commit graph

639 commits

Author SHA1 Message Date
heatwole
0a9b75fbfd Adding html and url encoding and updating docs 2018-06-28 18:11:36 -05:00
Dean Karn
f28cb45dc0
Update README.md 2018-05-14 07:57:39 -07:00
Dean Karn
3e51773f21
Merge pull request #363 from tengis617/fix-comment-typo
fixed typo in comment
2018-05-14 07:57:16 -07:00
Tengis B
8d3aa5bde2 ✏️ fixed typo in comment 2018-05-10 11:57:50 +07:00
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
2018-05-09 09:00:03 -07:00
Dean Karn
801c8790f3
Update README.md 2018-05-09 08:31:40 -07:00
Dean Karn
9848c01055
Merge pull request #362 from jadhub/domainnamefix
Fix for Email - Hostname is not validated correctly #359
2018-05-09 08:30:19 -07:00
Joachim Adomeit
379fb67047 Fix for Email - Hostname is not validated correctly #359 2018-05-09 16:50:03 +02:00
Dean Karn
ee0bbdea51 increment version 2018-05-05 09:24:17 -07:00
Dean Karn
54da7fa48f fix linting and spelling errors 2018-05-05 09:23:38 -07:00
Dean Karn
b297167b88
Merge pull request #361 from jservice-rvbd/unique-for-maps
Extend the unique tag to also cover map values.
2018-05-05 07:47:09 -07:00
Dean Karn
f459c64611
Merge pull request #358 from Ashtonian/patch-1
add missing `Engine()` to default validator for gin override example
2018-05-05 07:46:33 -07:00
James Service
d978a4b421 Undo whitespace changes from gofmt. 2018-05-04 13:34:51 +01:00
James Service
fc5fbce706 Add new unique functionality to docstring. 2018-05-04 13:23:26 +01:00
James Service
8ae3903dd3 Extend the unique tag to also cover map values. 2018-05-04 13:20:05 +01:00
Ashton Kinslow
9f62099643
add missing Engine() to default validator
to meet new interface requirements in gin
2018-05-01 16:19:59 -05:00
Dean Karn
14984d9132 Merge branch 'QuestofIranon-patch-1' into v9 2018-04-09 22:32:07 -07:00
Dean Karn
b5512bc1ff Merge branch 'patch-1' of https://github.com/QuestofIranon/validator into QuestofIranon-patch-1 2018-04-09 22:31:46 -07:00
josh
073682ea75 added in more test cases and removed some redundant validation steps 2018-04-09 01:49:06 -07:00
josh
ce6284a6fc confirm only all upper or all lower case address are valid 2018-04-08 19:38:12 -07:00
josh
6deddf27eb proper bech32 address validation 2018-04-08 19:38:12 -07:00
josh
3df85bdcfc p2sh validation and more tests 2018-04-08 19:38:12 -07:00
josh
60417282a4 verifies p2pkh addresses 2018-04-08 19:38:12 -07:00
josh
36d83b0b83 Added in validation function, tests, and docs 2018-04-08 19:38:12 -07:00
Dean Karn
ff1ee42e83
Update README.md 2018-04-08 10:23:56 -07:00
Dean Karn
d3984c2e0b
Update main.go 2018-04-08 10:21:03 -07:00
Dean Karn
2a8a333913
Update doc.go 2018-04-08 10:17:23 -07:00
Dean Karn
4894e4ca6c
Merge pull request #351 from kgeorgiou/v9
Add validation for base64 URL safe values
2018-04-08 10:14:56 -07:00
josh
ba5836f763 add bitcoin and ethereum address regexes 2018-04-06 19:58:09 -07:00
Kyriakos Georgiou
030800a855 Add validation for base64 URL safe values 2018-03-28 01:24:00 -04:00
Dean Karn
8ce234ff02
Update README.md 2018-03-19 08:47:08 -07:00
Dean Karn
b226c5e0d7
Merge pull request #350 from afranioce/v9
add brazilian portuguese translations
2018-03-19 08:46:39 -07:00
Afranio Martins
5186bfe8b5 add brazilian portuguese translations 2018-03-08 13:02:55 -03:00
Dean Karn
1b8c8e19cd
Merge pull request #348 from fdelbos/french-translation
add french translations
2018-03-05 07:02:40 -08:00
Frederic Delbos
4dbd40f597 add french translations 2018-03-03 11:57:07 +01:00
Dean Karn
150fe5b6a4
Update README.md 2018-02-20 08:21:16 -08:00
Dean Karn
34ccc97914
Merge pull request #343 from ansel1/oneof
Add oneof validation
2018-02-20 08:20:29 -08:00
Russ Egan
2e9adc3329 swapped mutex for rwmutex
similiar single-goroutine performance, slightly better concurrent performance.
2018-02-19 11:03:16 -06:00
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”)
2018-02-16 11:05:31 -06:00
Dean Karn
535f85221e
Update README.md 2018-02-15 08:51:41 -08:00
Dean Karn
5e036656b8 Add hostname_rfc1123 validation 2018-02-15 08:50:04 -08:00
Dean Karn
3620d3c069 update docs for FieldWithValue=>VarWithValue 2018-02-03 10:35:28 -08:00
Dean Karn
36cd0d5b69
Merge pull request #340 from glb/v9
Support translating field errors when field is of kind reflect.Ptr
2018-02-03 10:28:59 -08:00
Geoff Baskwill
866bd2a946 Support translating field errors when field is of kind reflect.Ptr
Previously, if fields were of kind `reflect.Ptr`, the translation of
validation errors used the default string, resulting in unexpected
output.

Now the default translations use the field's `Elem()` kind (for example
for `*string` the `Elem()` is `string`), resulting in much more natural
output.
2018-02-02 16:39:49 -05:00
Dean Karn
48a433ba4b
Merge pull request #336 from go-playground/correct-var-lock
Correct Var tagCache locking
2018-01-14 14:12:31 -08:00
Dean Karn
e00f5e092a split out to function, defer is needed to handle panics 2018-01-14 14:10:57 -08:00
Dean Karn
b962f3d7d5 Correct Var tagCache locking 2018-01-14 13:58:17 -08:00
Dean Karn
230db62e07
update docs to clarify or vs tag separators (#334) 2018-01-05 19:46:09 -08:00
Dean Karn
b1f51f36f1
Correct consequtive or logic (#330) 2017-12-13 08:54:38 -08:00
Dean Karn
61caf9d303
add map key validation support (#324) 2017-11-12 20:58:10 -08:00