Documentation ¶
Index ¶
Constants ¶
View Source
const OnetimeTokenExpireDuration = 60 * 60 * 6
Variables ¶
View Source
var OnetimeTokenExpireIndex = mongo.IndexModel{ Keys: bson.D{{"generated_at", -1}}, Options: options.Index().SetName("idx_expire").SetExpireAfterSeconds(OnetimeTokenExpireDuration + 60), }
View Source
var OnetimeTokenHayabusaIndex = mongo.IndexModel{ Keys: bson.D{{"hayabusa_id", -1}}, Options: options.Index().SetName("idx_hayabusa_id"), }
View Source
var OnetimeTokenIndex = mongo.IndexModel{ Keys: bson.D{{"token", -1}}, Options: options.Index().SetName("idx_onetime_token").SetUnique(true), }
View Source
var PlayerIndex = mongo.IndexModel{ Keys: bson.D{{"hayabusa_id", -1}}, Options: options.Index().SetName("idx_hayabusa_id").SetUnique(true), }
PlayerIndex declares index of Player
Functions ¶
func NewOnetimeToken ¶
func NewOnetimeToken() string
NewOnetimeToken generates onetime token of user
Types ¶
type MsgOnetimeToken ¶
type OnetimeToken ¶
type OnetimeToken struct { HayabusaID string `bson:"hayabusa_id"` ServerID string `bson:"server_id"` Token string `bson:"token"` Permission uint8 `bson:"permission"` GeneratedAt hybs.Time `bson:"generated_at"` }
func (*OnetimeToken) ToMsg ¶
func (token *OnetimeToken) ToMsg() *MsgOnetimeToken
Click to show internal directories.
Click to hide internal directories.