method

package
v0.0.0-...-1c441a6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 24, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetQuestionsAnswers

func GetQuestionsAnswers(c *gin.Context, dbState DBState)

func HomePage

func HomePage(c *gin.Context)

func JoinLobby

func JoinLobby(c *gin.Context, dbState DBState)

func ParseResponse

func ParseResponse(c *gin.Context, dbState DBState)

func RegisterUser

func RegisterUser(c *gin.Context, dbState DBState)

func RetrieveLeadboard

func RetrieveLeadboard(c *gin.Context, dbState DBState)

func RetrieveNextSession

func RetrieveNextSession(c *gin.Context)

func UserInfo

func UserInfo(c *gin.Context, dbState DBState)

Types

type Answer

type Answer struct {
	AnswerID   int    `json:"answer-id"`
	AnswerText string `json:"answer-text"`
}

type DBState

type DBState struct {
	Username     string
	Password     string
	Host         string
	Port         int
	DatabaseName string
}

type JWTClaims

type JWTClaims struct {
	Id     int    `json:"id"`
	Nick   string `json:"nick"`
	Image  string `json:"image"`
	QRcode string `json:"qr_code"`
	jwt.StandardClaims
}

func ParseJWTToken

func ParseJWTToken(tokenString string) (*JWTClaims, error)

type LobbyRequest

type LobbyRequest struct {
	JWT       string `json:"token"`
	LobbyType int    `json:"lobby"`
}

type NextSession

type NextSession struct {
	Time time.Time `json:"time"`
}

type Question

type Question struct {
	QuestionID    int      `json:"question-id"`
	QuestionText  string   `json:"question-text"`
	CorrectAnswer int      `json:"correct-answer-id"`
	Points        int      `json:"point"`
	Answers       []Answer `json:"answers"`
}

func ConvertQuestionDBToQuestion

func ConvertQuestionDBToQuestion(qdb []database.QuestionDB) []Question

func GetQuestions

func GetQuestions(c *gin.Context, dbState DBState) ([]Question, error)

type ResultRequest

type ResultRequest struct {
	JWT string `json:"token"`
}

type ResultResponse

type ResultResponse struct {
	Nick      string `json:"nick"`
	UserImage string `json:"user-image"`
	Points    int    `json:"points"`
	Trend     bool   `json:"trendGood"`
}

type UserLogin

type UserLogin struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL