Documentation ¶
Index ¶
- type Generator
- type StringFormat
- func Date(arg string) StringFormat
- func DateTime(arg string) StringFormat
- func Email(arg string) StringFormat
- func HTML(arg string) StringFormat
- func HasLowercase(arg string) StringFormat
- func HasNumbers(arg string) StringFormat
- func HasUppercase(arg string) StringFormat
- func Hostname(arg string) StringFormat
- func IPv4(arg string) StringFormat
- func IPv6(arg string) StringFormat
- func In(arg string) StringFormat
- func MatchRegex(arg string) StringFormat
- func NoHTML(arg string) StringFormat
- func NotIn(arg string) StringFormat
- func ObjectID(arg string) StringFormat
- func Time(arg string) StringFormat
- func Token(arg string) StringFormat
- func URI(arg string) StringFormat
- func UnsafeAny(arg string) StringFormat
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Generator ¶ added in v0.10.0
type Generator func(string) StringFormat
Generator is a function that takes an optional parameter and generates a StringFormat function
type StringFormat ¶
StringFormat tries to force a value to fit the desired format. If it cannot safely convert the value into the specified format, then it returns empty string and an error message.
func Date ¶
func Date(arg string) StringFormat
func DateTime ¶
func DateTime(arg string) StringFormat
func Email ¶
func Email(arg string) StringFormat
Email validates an email address using Go's built-in system email parser.
func HTML ¶
func HTML(arg string) StringFormat
HTML allows basic HTML tags, but strips iframes, object, embed, style, script tags.
func HasLowercase ¶
func HasLowercase(arg string) StringFormat
func HasNumbers ¶
func HasNumbers(arg string) StringFormat
func HasUppercase ¶
func HasUppercase(arg string) StringFormat
func Hostname ¶
func Hostname(arg string) StringFormat
func IPv4 ¶
func IPv4(arg string) StringFormat
func IPv6 ¶
func IPv6(arg string) StringFormat
func In ¶
func In(arg string) StringFormat
func MatchRegex ¶
func MatchRegex(arg string) StringFormat
func NotIn ¶
func NotIn(arg string) StringFormat
func ObjectID ¶
func ObjectID(arg string) StringFormat
ObjectID validates a mongodb-style identifier (24 hexadecimal characters)
func Time ¶
func Time(arg string) StringFormat
func Token ¶
func Token(arg string) StringFormat
Token validates a simple token string suitable for use as URL identifiers
func URI ¶
func URI(arg string) StringFormat
func UnsafeAny ¶ added in v0.7.0
func UnsafeAny(arg string) StringFormat
UnsafeAny leaves the string format untouched.
Click to show internal directories.
Click to hide internal directories.