Skip to content

Commit e530eb5

Browse files
Dean KarnDean Karn
authored andcommitted
add documentation for new base64 validator
1 parent 1d008b4 commit e530eb5

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

doc.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -292,15 +292,23 @@ Here is a list of the current built in validators:
292292
This may not conform to all possibilities of any rfc standard, but neither
293293
does any email provider accept all posibilities...
294294
(Usage: email)
295+
295296
url
296297
This validates that a string value contains a valid url
297298
This will accept any url the golang request uri accepts but must contain
298299
a schema for example http:// or rtmp://
299300
(Usage: url)
301+
300302
uri
301303
This validates that a string value contains a valid uri
302304
This will accept any uri the golang request uri accepts (Usage: uri)
303305
306+
base64
307+
This validates that a string value contains a valid base64 value.
308+
Although an empty string is valid base64 this will report an empty string
309+
as an error, if you wish to accept an empty string as valid you can use
310+
this with the omitempty tag. (Usage: base64)
311+
304312
Validator notes:
305313
306314
regex

validator_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ import (
66
"testing"
77
"time"
88

9-
// "gopkg.in/bluesuncorp/validator.v5"
10-
"github.com/joeybloggs/validator"
9+
"gopkg.in/bluesuncorp/validator.v5"
1110
. "gopkg.in/check.v1"
1211
)
1312

0 commit comments

Comments
 (0)