utils

package
v1.0.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 7, 2019 License: GPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BaiduUrlPush

func BaiduUrlPush(urls []string)

百度链接推送

func BuildAbsUrl

func BuildAbsUrl(path string) string

func BuildArticleUrl

func BuildArticleUrl(articleId int64) string

文章详情

func BuildTopicUrl

func BuildTopicUrl(topicId int64) string

话题详情

func BuildUserUrl

func BuildUserUrl(userId int64) string

用户主页

func GetMarkdownSummary

func GetMarkdownSummary(markdown string) string

截取markdown摘要

func GetUserRoles

func GetUserRoles(roles string) []string

获取用户角色

func IndexOf

func IndexOf(userIds []int64, userId int64) int

index of

func InitEmail added in v1.0.1

func InitEmail()

func IsInternalUrl added in v1.0.5

func IsInternalUrl(rawUrl string) bool

func IsProd

func IsProd() bool

是否是正式环境

func IsValidateUsername added in v1.0.2

func IsValidateUsername(username string) bool

验证用户名合法性,用户名必须由5-12位(数字、字母、_、-)组成,且必须以字母开头。

func SendEmail

func SendEmail(to string, subject, html string) error

func SendTemplateEmail added in v1.0.2

func SendTemplateEmail(to, subject, title, content, quoteContent, url string) error

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL