Documentation ¶
Index ¶
- Constants
- func AuthToken(tokenString string, secret string) (bool, string)
- func GenerateToken(email string, expireTime time.Duration, secret string) (string, error)
- func MapToStr(m map[string]interface{}) string
- func Pic2Base64(picPath string) (string, error)
- func StrToMap(s string) map[string]interface{}
- func VerifyEmailFormat(email string) bool
- type UserToken
Constants ¶
View Source
const ( UserExpireDuration = time.Hour * 2 UserSecretKey = "front_user_token" AdminExpireDuration = time.Hour * 48 AdminSecretKey = "admin_user_token" )
Variables ¶
This section is empty.
Functions ¶
func GenerateToken ¶
func Pic2Base64 ¶
Pic2Base64 converts a picture to base64 string
func VerifyEmailFormat ¶
VerifyEmailFormat verifies if the email address is valid
Types ¶
Click to show internal directories.
Click to hide internal directories.