Documentation ¶
Index ¶
- Variables
- func Add(left interface{}, right interface{}) interface{}
- func AddSuffix(s string, suffix string, args ...string) string
- func Append(renderArgs map[string]interface{}, key string, value interface{}) string
- func Base64Decode(s string) string
- func CaptchaForm(args ...interface{}) template.HTML
- func CaptchaVerify(captchaSolution string, idGet func(string, ...string) string) bool
- func Concat(s ...string) string
- func Default(defaultV interface{}, v interface{}) interface{}
- func Div(left interface{}, right interface{}) interface{}
- func DurationFormat(lang interface{}, t interface{}, args ...string) *com.Durafmt
- func Eq(left interface{}, right interface{}) bool
- func FriendlyTime(t interface{}, args ...string) string
- func Hash(text, salt string, positions ...uint) string
- func Ignore(_ interface{}) interface{}
- func InExt(fileName string, exts ...string) bool
- func InStrSlice(values []string, value string) bool
- func IsEmpty(a interface{}) bool
- func IsInf(v interface{}, s interface{}) bool
- func IsNaN(v interface{}) bool
- func IsNil(a interface{}) bool
- func JSONDecode(s string) map[string]interface{}
- func JSONEncode(s interface{}, indents ...string) string
- func Math(op string, args ...interface{}) interface{}
- func Mul(left interface{}, right interface{}) interface{}
- func New() (r template.FuncMap)
- func Nl2br(text string) string
- func NlToBr(text string) template.HTML
- func NotEmpty(a interface{}) bool
- func Now() time.Time
- func NumberFormat(number interface{}, precision int, delim ...string) string
- func SafeBase64Decode(s string) string
- func SearchStrSlice(values []string, value string) int
- func Set(renderArgs map[string]interface{}, key string, value interface{}) string
- func StrToSlice(s string, sep string) []interface{}
- func Sub(left interface{}, right interface{}) interface{}
- func TimestampToTime(timestamp interface{}) time.Time
- func ToCSS(raw string) template.CSS
- func ToDuration(t interface{}, args ...string) time.Duration
- func ToFixed(value interface{}, precision interface{}) string
- func ToFloat64(value interface{}) float64
- func ToHTML(raw string) template.HTML
- func ToHTMLAttr(raw string) template.HTMLAttr
- func ToHTMLAttrs(raw map[string]interface{}) (r map[template.HTMLAttr]interface{})
- func ToJS(raw string) template.JS
- func ToSlice(s ...interface{}) []interface{}
- func ToStrSlice(s ...string) []string
- func ToURL(raw string) template.URL
- func TsToDate(format string, timestamp interface{}) string
- func TsToTime(timestamp interface{}) time.Time
- func URLDecode(s string) string
- func URLValues(values ...interface{}) url.Values
Constants ¶
This section is empty.
Variables ¶
View Source
var ( HashSalt = time.Now().Format(time.RFC3339) HashClipPositions = []uint{1, 3, 8, 9} )
View Source
var TplFuncMap template.FuncMap = template.FuncMap{ "Now": Now, "ElapsedMemory": com.ElapsedMemory, "TotalRunTime": com.TotalRunTime, "CaptchaForm": CaptchaForm, "FormatByte": com.FormatByte, "FriendlyTime": FriendlyTime, "FormatPastTime": com.FormatPastTime, "DateFormat": com.DateFormat, "DateFormatShort": com.DateFormatShort, "Ts2time": TsToTime, "Ts2date": TsToDate, "Eq": Eq, "Add": Add, "Sub": Sub, "Div": Div, "Mul": Mul, "IsNil": IsNil, "IsEmpty": IsEmpty, "NotEmpty": NotEmpty, "IsNaN": IsNaN, "IsInf": IsInf, "Html": ToHTML, "Js": ToJS, "Css": ToCSS, "ToJS": ToJS, "ToCSS": ToCSS, "ToURL": ToURL, "ToHTML": ToHTML, "ToHTMLAttr": ToHTMLAttr, "ToHTMLAttrs": ToHTMLAttrs, "ToStrSlice": ToStrSlice, "ToDuration": ToDuration, "Str": com.Str, "Int": com.Int, "Int32": com.Int32, "Int64": com.Int64, "Uint": com.Uint, "Uint32": com.Uint32, "Uint64": com.Uint64, "Float32": com.Float32, "Float64": com.Float64, "ToFloat64": ToFloat64, "ToFixed": ToFixed, "Math": Math, "NumberFormat": NumberFormat, "DurationFormat": DurationFormat, "Contains": strings.Contains, "HasPrefix": strings.HasPrefix, "HasSuffix": strings.HasSuffix, "Trim": strings.TrimSpace, "TrimLeft": strings.TrimLeft, "TrimRight": strings.TrimRight, "TrimPrefix": strings.TrimPrefix, "TrimSuffix": strings.TrimSuffix, "ToLower": strings.ToLower, "ToUpper": strings.ToUpper, "LowerCaseFirst": com.LowerCaseFirst, "CamelCase": com.CamelCase, "PascalCase": com.PascalCase, "SnakeCase": com.SnakeCase, "Reverse": com.Reverse, "Ext": filepath.Ext, "InExt": InExt, "Concat": Concat, "Replace": strings.Replace, "Split": strings.Split, "Join": strings.Join, "Substr": com.Substr, "StripTags": com.StripTags, "Nl2br": NlToBr, "AddSuffix": AddSuffix, "JSONEncode": JSONEncode, "JSONDecode": JSONDecode, "URLEncode": com.URLEncode, "URLDecode": URLDecode, "Base64Encode": com.Base64Encode, "Base64Decode": Base64Decode, "SafeBase64Encode": com.SafeBase64Encode, "SafeBase64Decode": SafeBase64Decode, "Hash": Hash, "InSlice": com.InSlice, "InSlicex": com.InSliceIface, "Set": Set, "Append": Append, "InStrSlice": InStrSlice, "SearchStrSlice": SearchStrSlice, "URLValues": URLValues, "ToSlice": ToSlice, "StrToSlice": StrToSlice, "Regexp": regexp.MustCompile, "RegexpPOSIX": regexp.MustCompilePOSIX, "Ignore": Ignore, "Default": Default, }
Functions ¶
func Base64Decode ¶ added in v1.3.5
func CaptchaVerify ¶
CaptchaVerify 验证码验证
func DurationFormat ¶ added in v1.3.5
func FriendlyTime ¶
func InStrSlice ¶
func JSONDecode ¶ added in v1.3.5
func JSONEncode ¶ added in v1.3.5
func NumberFormat ¶ added in v1.3.0
func SafeBase64Decode ¶ added in v1.3.5
func SearchStrSlice ¶
func StrToSlice ¶ added in v1.3.5
func TimestampToTime ¶ added in v1.2.0
func ToDuration ¶ added in v1.3.5
func ToHTMLAttr ¶
func ToHTMLAttrs ¶
func ToStrSlice ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.