format

package
v0.15.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 10, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Function

type Function func(string) StringFormat

Function is a function that takes an optional parameter and generates a StringFormat function

type StringFormat

type StringFormat func(string) (string, error)

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 added in v0.14.0

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 NoHTML added in v0.14.0

func NoHTML(arg string) StringFormat

NoHTML strips all HTML tags from a string.

func NotIn

func NotIn(arg string) StringFormat

func ObjectID added in v0.14.1

func ObjectID(arg string) StringFormat

ObjectID validates a mongodb-style identifier (24 hexadecimal characters)

func Time

func Time(arg string) StringFormat

func Token added in v0.14.6

func Token(arg string) StringFormat

Token validates a simple token string suitable for use as URL identifiers

func URI

func URI(arg string) StringFormat

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL