Documentation ¶
Index ¶
- Variables
- func GenRandomName(n int) string
- func GenUrls(strs ...string) ([]*url.URL, error)
- func GetFuncMap() template.FuncMap
- func GetMd5String(b []byte) string
- func IsFFmpegExist() bool
- func Match1(re, str string) string
- func ParseString(str string, filter ...StringFilter) string
- type StringFilter
- type StringFilterChain
- type StringFilterFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var ParseUnicode = StringFilterFunc(func(str string) string { buf := new(bytes.Buffer) chars := []byte(str) for i := 0; i < len(str); { if chars[i] == 92 && chars[i+1] == 117 { t, _ := strconv.ParseInt(string(chars[i+2:i+6]), 16, 32) buf.WriteString(fmt.Sprintf("%c", t)) i += 6 } else { buf.WriteByte(chars[i]) i++ } } return buf.String() })
View Source
var ReplaceIllegalChar = StringFilterFunc(func(str string) string { reg := regexp.MustCompile(`[\/\\\:\*\?\"\<\>\|]`) return reg.ReplaceAllString(str, "_") })
View Source
var UnescapeHTMLEntity = StringFilterFunc(html.UnescapeString)
Functions ¶
func GenRandomName ¶
func GetFuncMap ¶
func GetMd5String ¶
func IsFFmpegExist ¶
func IsFFmpegExist() bool
func ParseString ¶
func ParseString(str string, filter ...StringFilter) string
Types ¶
type StringFilter ¶
type StringFilterChain ¶
type StringFilterChain struct {
// contains filtered or unexported fields
}
func NewStringFilterChain ¶
func NewStringFilterChain(filter ...StringFilter) *StringFilterChain
func (*StringFilterChain) Do ¶
func (c *StringFilterChain) Do(str string) string
type StringFilterFunc ¶
func (StringFilterFunc) Do ¶
func (f StringFilterFunc) Do(s string) string
Click to show internal directories.
Click to hide internal directories.