Documentation ¶
Index ¶
- Constants
- func AvatarResize(srcImg image.Image, w, h int, filePath string) error
- func CheckError(err error, info string) (res bool)
- func CheckImageType(buff []byte) string
- func CheckTags(tags string) string
- func FetchAvatar(url, save, ua string) error
- func FlarumReadLocale(flarumDir string, extDirs []string, localeDir, locale string) map[string]string
- func GenerateAvatar(sex, userName string, w, h int, filePath string) error
- func GetImageObj(buff *bytes.Buffer) (image.Image, error)
- func GetImageObj2(buff *bytes.Buffer) (image.Image, error)
- func GetLogger() *logging.Logger
- func GetNewToken() string
- func GetUUID() string
- func HashFileMD5(filePath string) (string, error)
- func ImageResize(srcImg image.Image, w, h int) *image.NRGBA
- func InitLogger(lvl string)
- func IsMail(str string) bool
- func IsNickname(str string) bool
- func IsUserName(str string) bool
- func RemoveCharacter(str string) string
- func SliceUniqInt(s []int) []int
- func SliceUniqStr(s []string) []string
- func TimeFmt(tp interface{}, sample string, tz int) string
- func TimeHuman(ts interface{}) string
- func TimeNow() uint64
- func VerifyToken(realToken, sentToken string) bool
Constants ¶
View Source
const (
TIME_FMT = "2006-01-02 15:04"
)
Variables ¶
This section is empty.
Functions ¶
func CheckError ¶
CheckError error check, 检查到error, 返回true
func CheckImageType ¶
func FetchAvatar ¶
func FlarumReadLocale ¶
func FlarumReadLocale(flarumDir string, extDirs []string, localeDir, locale string) map[string]string
FlarumReadLocale 读取Flarum的语言包
func HashFileMD5 ¶
func IsNickname ¶
func IsUserName ¶
func RemoveCharacter ¶
func SliceUniqInt ¶
func SliceUniqStr ¶
func VerifyToken ¶
VerifyToken verifies the sent token equals the real one and returns a bool value indicating if tokens are equal. Supports masked tokens. realToken comes from Token(r) and sentToken is token sent unusual way.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.