utils

package
v0.0.0-...-8e1329c Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2021 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnonymousTokenEncrypt

func AnonymousTokenEncrypt(userType int32, userID int64, expireTime int64) string

AnonymousTokenEncrypt 匿名用户token加密.

func GenCode

func GenCode(length int) string

GenCode 生成验证码.

func GetCode

func GetCode(bizType, tel string) (code string, err error)

GetCode 查询验证码.

func InitRedisStore

func InitRedisStore(Config *configs.ServerConfig) (err error)

InitRedisStore 初始化Redis存储.

func SaveCode

func SaveCode(bizType, tel, code string, expires time.Duration) (err error)

SaveCode 保存验证码

func SmsSend

func SmsSend(tel, code string) (reason string, err error)

SmsSend 发送短信.

func TokenCheck

func TokenCheck(token string, userID int64, userType int32, platform string) (err error)

TokenCheck 检查Token是否存在,

func TokenDecrypt

func TokenDecrypt(token string) (userType int32, userID int64, expireTime int64, err error)

TokenDecrypt token解密

func TokenDelete

func TokenDelete(userID int64, token string) (err error)

TokenDelete 删除Token

func TokenEncrypt

func TokenEncrypt(userType int32, userID int64, expireTime int64) string

TokenEncrypt token加密

func TokenSave

func TokenSave(token string, userID int64, userType int32, platform string, tokenTimeout time.Duration) (err error)

TokenSave 保存Token

Types

This section is empty.

Jump to

Keyboard shortcuts

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