Documentation
¶
Index ¶
Constants ¶
View Source
const Nil = redis.Nil
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthCode ¶
type AuthCode struct {
Entity
UserID uint `gorm:"not null"`
User *User `gorm:"foreignKey:UserID"`
Value string `gorm:"not null;unique;uniqueIndex"`
Expires time.Time
}
A Discord login code for a user.
type Creatable ¶
type Creatable struct {
Entity
Created time.Time
CreatorID uint `gorm:"not null"`
Creator *User `gorm:"foreignKey:CreatorID"`
}
func NewCreatable ¶
type MapPointer ¶
type Session ¶
type Session struct {
Entity
Span
UserID uint // null OK
UUID string `gorm:"not null"`
HostID uint `gorm:"not null"`
// desktop, mobile, web
Device string `gorm:"not null"`
Visits []*Visit `gorm:"foreignKey:SessionID"`
}
Logs a player's game session from start to finish.
type StateService ¶
func NewStateService ¶
func NewStateService(settings config.RedisSettings) *StateService
type User ¶
type User struct {
Entity
// The most recent Sauer name the user used
Nickname string `gorm:"size:15"`
// Discord unique ID
UUID string `gorm:"unique;uniqueIndex;size:32"`
// The user's Discord username
Username string `gorm:"size:32"`
// #1234 or whatever
Discriminator string `gorm:"size:32"`
// The prefix for Discord's avatar scheme
Avatar string `gorm:"size:128"`
// For desktop auth
PublicKey string
PrivateKey string
LastLogin time.Time
HomeID uint
Home *Space `gorm:"foreignKey:HomeID"`
Ranking []*Ranking `gorm:"foreignKey:UserID"`
Maps []*MapPointer `gorm:"foreignKey:CreatorID"`
Spaces []*Space `gorm:"foreignKey:OwnerID"`
Sessions []*Session `gorm:"foreignKey:UserID"`
}
Click to show internal directories.
Click to hide internal directories.