Documentation
¶
Index ¶
- func BeginsWith(s string, testStr []string) bool
- func ContainsAny(str string, substrings []string) bool
- func CreateDirIfNotExists(path string)
- func IsAbsoluteURL(href string) bool
- func IsValidScheme(scheme string) bool
- func PermittedValue[T comparable](value T, permitterValues ...T) bool
- func PrefixString(s []string, prefix string) []string
- func ValuePresent(needle string, haystack []string) bool
- type Validator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BeginsWith ¶
beginsWith returns true if s begins with any of the strings in the provided slice
func ContainsAny ¶
ContainsAny checks if str contains any of the substrings
func CreateDirIfNotExists ¶
func CreateDirIfNotExists(path string)
CreateDirIfNotExists will create a directory at path if it doesn't exist using os.MkdirAll
func IsAbsoluteURL ¶
isAbsoluteURL checks if href is absolute URL
e.g.
<http|https>://google.com/query -> true
/query -> false
func IsValidScheme ¶
isValidScheme tells if the scheme is valid
func PermittedValue ¶ added in v0.9.0
func PermittedValue[T comparable](value T, permitterValues ...T) bool
func PrefixString ¶ added in v0.9.0
PrefixString returns []string with every element of s prefixed with prefix
func ValuePresent ¶
ValuePresent checks if needle is present in haystack
Types ¶
type Validator ¶
func NewValidator ¶
func NewValidator() *Validator
Click to show internal directories.
Click to hide internal directories.