Documentation
¶
Index ¶
- Constants
- func Add(sid string, ss *Session) (err error)
- func CompareAndSwap(sid string, ss *Session) (err error)
- func Delete(sid string) (err error)
- func NewGuestSessionId() (sid string, err error)
- func NewSessionId() (sid string, err error)
- func Set(sid string, ss *Session) (err error)
- type CheckCode
- type Session
Constants ¶
View Source
const CheckCodeMaxTimes = 3 // 校验码最多可以校验多少次
Variables ¶
This section is empty.
Functions ¶
func CompareAndSwap ¶
设置 sid-Session, 该 Session 是通过 Get 获取的, 如果在 Get 之后该 sid 对应的 Session 发生改变, 则返回错误.
Types ¶
type Session ¶
type Session struct { TokenSignature string `json:"token_sign"` // Token 签名; 安全考虑, 比对客户端传过来的 token 的签名部分 UserId int64 `json:"user_id,omitempty"` // 当前用户 PasswordTag string `json:"password_tag,omitempty"` // 认证时的 password_tag, 对于 AuthType 是 AuthTypeEmailPassword, AuthTypePhonePassword 时有效 EmailCheckCode *CheckCode `json:"email_checkcode,omitempty"` // 邮箱校验码 PhoneCheckCode *CheckCode `json:"phone_checkcode,omitempty"` // 手机校验码 OAuth2State string `json:"oauth2_state,omitempty"` // 微信公众号 oauth 认证的 state // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.