models

package
v0.0.0-...-0e8a7df Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2021 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Answer

type Answer struct {
	gorm.Model
	User    int
	RoundID int
}

type CreateUser

type CreateUser struct {
	Name string `json:"name"`
}

type Creator

type Creator struct {
	gorm.Model
	Name         string
	Healthpoints int `gorm:"default=30"`
	GameID       string
}

type Enemy

type Enemy struct {
	gorm.Model
	Healthpoints int `gorm:"default=50"`
	GameID       string
}

type Game

type Game struct {
	ID             string `gorm:"uniqueIndex" sql:"primary_key;defautl:uuid_generate_v4()"`
	GamePin        uint64
	Creator        Creator
	TeamMate       TeamMate
	TeamMateJoined bool
	Enemy          Enemy
}

func (*Game) BeforeCreate

func (game *Game) BeforeCreate(tx *gorm.DB) (err error)

type Question

type Question struct {
	gorm.Model
	Text string
}

type Round

type Round struct {
	gorm.Model
	GameBaseID int64
	GameID     string
	QuestionID uint
	Answers    []Answer
}

type TeamMate

type TeamMate struct {
	gorm.Model
	Name         string
	Healthpoints int `gorm:"default=30"`
	GameID       string
}

Jump to

Keyboard shortcuts

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