Documentation ¶
Index ¶
- func AddQueryToURL(urlStr string, queryMap map[string]string) string
- func CheckFileExist(path string) bool
- func ContainsStr(s []string, v string) bool
- func CopyStruct(src *map[string]interface{}, dest *map[string]interface{}) error
- func EnsureDir(dir string) error
- func GetMD5Hash(text string) string
- func GetSha256Hash(text string) string
- func Marked(markdownStr string) (string, error)
- func PseudorandomString(length int) string
- func PseudorandomStringWithAlphabet(length int, alphabet string) string
- func RandomString(length int) string
- func RandomStringWithAlphabet(length int, alphabet string) string
- func RemoveBlankStrings(s []string) []string
- func RemoveDuplicates(arr []string) []string
- func RenderMustaches(data string, dict map[string]interface{}, ...) string
- func SplitAndTrimSpace(s string, sep string) []string
- func StructToFlatDotMap(s interface{}) map[string]interface{}
- func StructToMap(s interface{}) map[string]interface{}
- func ToString(val interface{}) string
- func TruncateString(str string, length int) string
- func ValidateEmail(email string) bool
- func ValidateURL(v string) bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckFileExist ¶
func ContainsStr ¶
ContainsStr returns true if an str is present in a iteratee.
func CopyStruct ¶
func GetMD5Hash ¶
func GetSha256Hash ¶
func PseudorandomString ¶
PseudorandomString generates a pseudorandom string with the specified length.
The generated string matches [A-Za-z0-9]+ and it's transparent to URL-encoding.
For a cryptographically random string (but a little bit slower) use RandomString instead.
func PseudorandomStringWithAlphabet ¶
PseudorandomStringWithAlphabet generates a pseudorandom string with the specified length and characters set.
For a cryptographically random (but a little bit slower) use RandomStringWithAlphabet instead.
func RandomString ¶
RandomString generates a cryptographically random string with the specified length.
The generated string matches [A-Za-z0-9]+ and it's transparent to URL-encoding.
func RandomStringWithAlphabet ¶
RandomStringWithAlphabet generates a cryptographically random string with the specified length and characters set.
It panics if for some reason rand.Int returns a non-nil error.
func RemoveBlankStrings ¶
func RemoveDuplicates ¶
RemoveDuplicates removes the duplicates strings from a Slice
func RenderMustaches ¶
func RenderMustaches(data string, dict map[string]interface{}, valueGetter ...func(k string, v interface{}) string) string
解析 Mustaches 语法 替换 {{ key }} 为 val
func SplitAndTrimSpace ¶
func StructToFlatDotMap ¶
func StructToFlatDotMap(s interface{}) map[string]interface{}
func StructToMap ¶
func StructToMap(s interface{}) map[string]interface{}
func ToString ¶
func ToString(val interface{}) string
任何类型转 String
(bool) true => (string) "true" (int) 0 => (string) "0"
func TruncateString ¶
func ValidateEmail ¶
func ValidateURL ¶
Types ¶
This section is empty.