Documentation
¶
Index ¶
- Variables
- func Add(a, b int) int
- func DatetimeToTimeZone(timeString string) (timeZone int64)
- func Default(value interface{}, defaultValue interface{}) interface{}
- func GetClientIP(r *http.Request) string
- func GetCurrentUrl(r *http.Request) string
- func GetLocalIp() string
- func GetRandomString(length uint) string
- func GetTemplateFuncs() map[string]interface{}
- func GetYear(dataTime string) string
- func InArray(needle interface{}, haystack interface{}) bool
- func IsDirExists(path string) bool
- func Md5(text string) string
- func NewContext() *gin.Context
- func NewLogId() string
- func Pager(pagenumber, pagecount int, baseUrl string) template.HTML
- func Sequence(n int) []int
- func ShowMonthDay(dataTime string) string
- func ShowSiteCFG(key string) template.HTML
- func Subtract(a, b int) int
- func Unescaped(x string) interface{}
Constants ¶
This section is empty.
Variables ¶
View Source
var TemplateFuncs = template.FuncMap{ "ShowMonthDay": ShowMonthDay, "GetYear": GetYear, "ShowSiteCFG": ShowSiteCFG, "Unescaped": Unescaped, "Pager": Pager, "subtract": Subtract, "add": Add, "sequence": Sequence, "default": Default, }
TemplateFuncs 模板函数映射 提供模板中可用的自定义函数
Functions ¶
func DatetimeToTimeZone ¶
DatetimeToTimeZone datetime格式时间转时间戳 timeString: 时间字符串,格式为"2006-01-02 15:04:05"
func Default ¶
func Default(value interface{}, defaultValue interface{}) interface{}
Default 默认值函数 value: 要检查的值,defaultValue: 默认值
func GetRandomString ¶
GetRandomString 生成随机字符串 length: 字符串长度
func NewContext ¶
func ShowMonthDay ¶
ShowMonthDay 获取datetime数据的月日 dataTime: 时间字符串,格式为"2006-01-02 15:04:05"
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.