Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DatabaseInstance ¶
type DatabaseInstance struct { }
DatabaseInstance is a singleton pattern database instance.
type Puzzle ¶
type Puzzle struct { PID uint32 `gorm:"column:pid;primary_key" json:"pid"` Type uint8 `gorm:"column:type" json:"type"` Content string `gorm:"column:content" json:"content"` Descriptor string `gorm:"column:descriptor" json:"descriptor"` Level uint8 `gorm:"column:level" json:"level"` Submited uint32 `gorm:"column:submited" json:"submited"` Passed uint32 `gorm:"column:passed" json:"passed"` CreatedTime time.Time `gorm:"column:created_time" json:"created_time"` }
Puzzle model
func (*Puzzle) AddPuzzleByPID ¶
AddPuzzleByPID gets a puzzle by its PID
func (*Puzzle) GetPuzzleByPID ¶
GetPuzzleByPID gets a puzzle by its PID
func (*Puzzle) SavePuzzleByPID ¶
SavePuzzleByPID saves a puzzle's info if it already exists.
type User ¶
type User struct { UID uint32 `gorm:"column:uid;primary_key" json:"uid"` Type uint8 `gorm:"column:type" json:"type"` Username string `gorm:"column:username" json:"username"` Authentication string `gorm:"column:authentication" json:"-"` Score uint32 `gorm:"column:score" json:"score"` Submited uint32 `gorm:"column:submited" json:"submited"` Passed uint32 `gorm:"column:passed" json:"passed"` CreatedTime time.Time `gorm:"column:created_time" json:"created_time"` }
User model
func (*User) CreateUser ¶
CreateUser creates a new user if it doesn't exist.
func (*User) DeleteUserByUID ¶
DeleteUserByUID deletes an user by its uid if it already exists.
func (*User) DeleteUserByUsername ¶
DeleteUserByUsername deletes an user by its username if it already exists.
func (*User) GetUserByUID ¶
GetUserByUID gets a user's info by its username.
func (*User) GetUserByUsername ¶
GetUserByUsername gets a user's info by its username.
func (*User) SaveUserByUID ¶
SaveUserByUID saves an user's info if it already exists.
Click to show internal directories.
Click to hide internal directories.