Documentation ¶
Index ¶
- Variables
- func EqualValue[T comparable](value1 T, value2 T) bool
- func Matches(value string, rxp *regexp.Regexp) bool
- func MaxChars(value string, n int) bool
- func MaxNumber[T number](value T, n T) bool
- func MinChars(value string, n int) bool
- func MinNumber[T number](value T, n T) bool
- func NotBlank(value string) bool
- func NotCero[T number](value T) bool
- func PermittedValue[T comparable](value T, permittedValues ...T) bool
- func Unique[T comparable](values []T) bool
- type OptionError
- type Validator
Constants ¶
This section is empty.
Variables ¶
View Source
var FileRX = regexp.MustCompile(`^[^/]*$`)
View Source
var HeaderRX = regexp.MustCompile("^([a-zA-Z0-9!#$%&'*+.^_`" + `|~-]+):[\S]+(, [a-zA-Z0-9!#$%&'*+.^_` + "`|~-]+:[" + `\S]+)*$`)
View Source
var MethodRX = regexp.MustCompile("^(GET|POST|PUT|DELETE|PATCH)$")
View Source
var ProxyRX = regexp.MustCompile("^(http://|socks5://)")
View Source
var URLRX = regexp.MustCompile("((((https?|ftps?|gopher|telnet|nntp)://)|(mailto:|news:))([-%()_.!~*';/?:@&=+$,A-Za-z0-9])+)")
Functions ¶
func EqualValue ¶
func EqualValue[T comparable](value1 T, value2 T) bool
EqualValue returns true if the values are equals
func MaxNumber ¶
func MaxNumber[T number](value T, n T) bool
MaxNumber returns true if a value is minor that n
func MinNumber ¶
func MinNumber[T number](value T, n T) bool
MinNumber returns true if a value is greater than n
func PermittedValue ¶
func PermittedValue[T comparable](value T, permittedValues ...T) bool
PermittedValue returns true if a value is in a list of permitted.
func Unique ¶
func Unique[T comparable](values []T) bool
Unique return true if all values in a slice are unique.
Types ¶
type OptionError ¶
Click to show internal directories.
Click to hide internal directories.