Documentation ¶
Index ¶
- Constants
- func EncodeMd5(str string) string
- func EncodeSha1(str string) string
- func GetRandomString(n int, alphabets ...byte) string
- func IsAlpha(str string) bool
- func IsAlphaNumeric(str string) bool
- func IsBase64(str string) bool
- func IsDataURI(str string) bool
- func IsEmail(data string) bool
- func IsEmpty(data string) bool
- func IsFile(filePath string) bool
- func IsFloat(str string) bool
- func IsInt(str string) bool
- func IsNumeric(data string) bool
- func IsURL(data string) bool
- func PBKDF2(password, salt []byte, iter, keyLen int, h func() hash.Hash) []byte
- func StringInSlice(str string, list []string) bool
- func StripTagsFromHtml(input string) string
- func SubString(str string, length int) string
- func ToBool(val interface{}) bool
- func ToFloat64(val interface{}) float64
- func ToInt(val interface{}) int
- func ToInt64(val interface{}) int64
- func ToString(val interface{}) string
- func ToTime(val interface{}) time.Time
- func ToUint32(val interface{}) uint32
- func ToUint64(val interface{}) uint64
Constants ¶
View Source
const ( Regex_Email string = "[\\w!#$%&'*+/=?^_`{|}~-]+(?:\\.[\\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\\w](?:[\\w-]*[\\w])?\\.)+[a-zA-Z0-9](?:[\\w-]*[\\w])?" Regex_Numeric string = "^[-+]?[0-9]+$" Regex_Alpha string = "^[a-zA-Z]+$" Regex_AlphaNumeric string = "^[a-zA-Z0-9]+$" Regex_Int string = "^(?:[-+]?(?:0|[1-9][0-9]*))$" Regex_Float string = "^(?:[-+]?(?:[0-9]+))?(?:\\.[0-9]*)?(?:[eE][\\+\\-]?(?:[0-9]+))?$" Regex_DataURI string = "^data:.+\\/(.+);base64$" Regex_URL string = `` /* 301-byte string literal not displayed */ Regex_Base64 string = "^(?:[A-Za-z0-9+\\/]{4})*(?:[A-Za-z0-9+\\/]{2}==|[A-Za-z0-9+\\/]{3}=|[A-Za-z0-9+\\/]{4})$" )
Variables ¶
This section is empty.
Functions ¶
func GetRandomString ¶
GetRandomString generate random string by specify chars.
func IsAlphaNumeric ¶
IsAlphanumeric check if the string contains only letters and numbers. Empty string is invalid.
func IsFile ¶
IsFile returns true if given path is a file, or returns false when it's a directory or does not exist.
func StringInSlice ¶
StringInSlice check if given string in list
func StripTagsFromHtml ¶
func ToFloat64 ¶
func ToFloat64(val interface{}) float64
ToFloat64 try to convert the argument into a float64
func ToString ¶
func ToString(val interface{}) string
ToString try to convert the argument into a string
Types ¶
This section is empty.
Directories ¶
Path | Synopsis |
---|---|
https://github.com/martini-contrib/acceptlang
|
https://github.com/martini-contrib/acceptlang |
Package uuid provides implementation of Universally Unique Identifier (UUID).
|
Package uuid provides implementation of Universally Unique Identifier (UUID). |
Click to show internal directories.
Click to hide internal directories.