Documentation ¶
Index ¶
Constants ¶
const (
Token_DefaultLifeSeconds = 60 * 30 //token默认有效期,默认30分钟有效期
)
Variables ¶
This section is empty.
Functions ¶
func CreateToken ¶
创建token Author: panxinming CreateTime: 2017-02-10 12:00 HttpMethod:Post Post Param:TokenInfo 返回结构:HandlerResponse 0: 成功 -100001:post data not legal -100002:AppID is empty -200001:no config RedisID_Token Redis -200002:create token error [uuid] -200003:create token error [redis set] Response.Message = TokenInfo
UPDATE LOG: 1、初始版本 --2017-02-10 12:00 by pxm
func QueryToken ¶
查询token Author: panxinming CreateTime: 2017-02-10 12:00 HttpMethod:Get Get Param: appid: 应用编码 token: token 返回结构:HandlerResponse 0: 成功 -100001:querystring token|appid is empty -200001:no config RedisID_Token Redis -200002:query token error [redis get] Response.Message = TokenInfo
UPDATE LOG: 1、初始版本 --2017-02-10 12:00 by pxm
func VerifyToken ¶
验证token Author: panxinming CreateTime: 2017-02-10 12:00 HttpMethod:Post Post Param:VerifyTokenRequest 返回结构:HandlerResponse 0: 成功 -100001:post data not legal -100002:AppID is empty -200001:no config RedisID_Token Redis -201001: query token exists error -201002: redis token not exists -202001: get token-locker error -202002: token-locker locked by other -203001: query token error -203002: redis token data not legal -203003: token body is not match
Response.Message = TokenInfo
UPDATE LOG: 1、初始版本 --2017-02-10 12:00 by pxm