Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Question ¶
type Question struct { ID uint `gorm:"primaryKey" json:"-"` Content string `json:"-"` Choices pq.StringArray `gorm:"type:text[]"` CorrectAnswers pq.StringArray `gorm:"type:text[]"` CreatedAt time.Time `gorm:"autoCreateTime" json:"-"` UpdatedAt time.Time `gorm:"autoUpdateTime" json:"-"` }
type QuestionOrmer ¶
type QuestionOrmer interface { GetAllQuestion() (ques []Question, err error) GetQuestionByID(id uint) (ques Question, err error) InsertQuestion(ques Question) (id uint, err error) UpdateQuestion(ques Question) (err error) DeleteQuestion(ques Question) (err error) }
func NewQuestionOrmer ¶
func NewQuestionOrmer(db *gorm.DB) QuestionOrmer
type ScoreBoard ¶
type ScoreOrmer ¶
type ScoreOrmer interface { GetScoreBoardByUserID(userId uint) (board []ScoreBoard, err error) InsertScoreBoard(board ScoreBoard) (id uint, err error) }
func NewScoreBoardOrmer ¶
func NewScoreBoardOrmer(db *gorm.DB) ScoreOrmer
type TokenOrmer ¶
type TokenOrmer interface { InsertToken(token Token) (id uint, err error) DeleteToken(token Token) (err error) GetTokenByRefreshToken(refreshToken string) (token Token, err error) }
func NewTokenOrmer ¶
func NewTokenOrmer(db *gorm.DB) TokenOrmer
type User ¶
type User struct { ID uint `gorm:"primaryKey" json:"-"` Username string `gorm:"uniqueIndex" json:"-"` Email string `gorm:"unique" json:"-"` Password string `json:"-"` IsAdmin bool `gorm:"default:false"` Bio string `json:"-"` CreatedAt time.Time `gorm:"autoCreateTime" json:"-"` UpdatedAt time.Time `gorm:"autoUpdateTime" json:"-"` }
Click to show internal directories.
Click to hide internal directories.