//
pkg.gl
Category
github.com/ElOtro/clean-api
internal
validator
package
0.0.0-20220905195115-f3c3a2100fa5
Repository:
https://github.com/elotro/clean-api.git
Documentation:
pkg.go.dev
Overview
Versions
1
Dependencies
1
Dependents
0
Files
43 SLOC
#
Functions
In
In returns true if a specific value is in a list of strings.
Matches
Matches returns true if a string value matches a specific regexp pattern.
New
New is a helper which creates a new Validator instance with an empty errors map.
Unique
Unique returns true if all string values in a slice are unique.
#
Variables
EmailRX
Declare a regular expression for sanity checking the format of email addresses (we'll use this later in the book).
#
Structs
Validator
Define a new Validator type which contains a map of validation errors.