Documentation
¶
Index ¶
Constants ¶
View Source
const SessionIdKey = "auth:session_id"
SessionIdKey Redis会话ID缓存key前缀 使用方式: fmt.Sprintf("%s:%s", SessionIdKey, sessionId) 存储值: userID
View Source
const TempOrderCacheKey = "temp_order:%s"
TempOrderCacheKey Redis临时订单缓存key模板 使用方式: fmt.Sprintf(TempOrderCacheKey, orderNo) TTL: 15分钟
Variables ¶
View Source
var Int64 int64
Int64 用于类型转换标识
Functions ¶
This section is empty.
Types ¶
type TemporaryOrderInfo ¶
type TemporaryOrderInfo struct {
OrderNo string `json:"order_no"` // 订单号
Identifier string `json:"identifier"` // 认证标识符(邮箱/Telegram ID等)
AuthType string `json:"auth_type"` // 认证类型(email/telegram等)
Password string `json:"password"` // 用户密码(已加密)
InviteCode string `json:"invite_code,omitempty"` // 邀请码(可选)
}
TemporaryOrderInfo 临时订单信息 用于Portal模块,存储未注册用户的临时认证信息
func (*TemporaryOrderInfo) Marshal ¶
func (t *TemporaryOrderInfo) Marshal() ([]byte, error)
Marshal 序列化为JSON
func (*TemporaryOrderInfo) Unmarshal ¶
func (t *TemporaryOrderInfo) Unmarshal(data []byte) error
Unmarshal 从JSON反序列化
type VerifyType ¶
type VerifyType int32
VerifyType is the type of verification code
const ( Register VerifyType = iota + 1 Security )
func ParseVerifyType ¶
func ParseVerifyType(i int32) VerifyType
func (VerifyType) String ¶
func (v VerifyType) String() string
Click to show internal directories.
Click to hide internal directories.