Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // WithDefault is a default policy. WithDefault = NewPolicy( []rune(lowercase+uppercase+numbers+symbols), regexpValidator{regexpString: regexp.QuoteMeta("a-zA-Z0-9!#$%&'\"()*+,-./:;<=>?@[\\]^_`{|}~")}) // WithLowercase is a policy with lowercase. WithLowercase = NewPolicy([]rune(lowercase), regexpValidator{regexpString: "a-z"}) // WithUppercase is a policy with uppercase. WithUppercase = NewPolicy([]rune(uppercase), regexpValidator{regexpString: "A-Z"}) // WithNumbers is a policy with numbers. WithNumbers = NewPolicy([]rune(numbers), regexpValidator{regexpString: "0-9"}) // WithSymbols is a policy with symbols. WithSymbols = NewPolicy( []rune(symbols), regexpValidator{regexpString: regexp.QuoteMeta("a-zA-Z0-9!#$%&'\"()*+,-./:;<=>?@[\\]^_`{|}~")}) // WithMinLength is a policy with minimum length. WithMinLength = func(min int) Policy { return NewPolicy([]rune{}, minLengthValidator{minLength: min}) } // WithMaxLength is a policy with maximum length. WithMaxLength = func(max int) Policy { return NewPolicy([]rune{}, maxLengthValidator{maxLength: max}) } // WithCustomString is a policy with custom string. WithCustomString = func(letters []rune) Policy { return NewPolicy(letters, regexpValidator{regexpString: regexp.QuoteMeta(string(letters))}) } )
Functions ¶
This section is empty.
Types ¶
Click to show internal directories.
Click to hide internal directories.