customTypes

package
v0.0.0-...-3bf928b Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateGame

type CreateGame struct {
	BggID *int
	Name  string
}

type CreatePlay

type CreatePlay struct {
	GameID int `json:"gameId"`
}

type CreatePlayer

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

type CreatePlayerPlay

type CreatePlayerPlay struct {
	PlayerID int      `json:"playerId"`
	PlayID   int      `json:"playId"`
	Score    *float64 `json:"score"`
}

type CreateSession

type CreateSession struct {
	PlayID          int  `json:"playId"`
	GameBelongsToID *int `json:"gameBelongsToId"`
}

type Game

type Game struct {
	ID          int `gorm:"primaryKey"`
	CreatedAt   time.Time
	UpdatedAt   time.Time
	DeletedAt   gorm.DeletedAt `gorm:"index"`
	Name        string
	Description string
	Price       *float64
	BggID       *int
	Plays       []*Play
}

type GetPlayerPlay

type GetPlayerPlay struct {
	PlayerID int `json:"playerId"`
	PlayID   int `json:"playId"`
}

type Play

type Play struct {
	ID        int `gorm:"primaryKey"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt gorm.DeletedAt `gorm:"index"`
	GameID    int
	Game      *Game
	Sessions  []*Session
	Players   []*PlayerPlay
}

type Player

type Player struct {
	ID        int `gorm:"primaryKey"`
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt gorm.DeletedAt `gorm:"index"`
	Name      string
	Plays     []*PlayerPlay
}

type PlayerPlay

type PlayerPlay struct {
	PlayerID  int `gorm:"primaryKey"`
	Player    *Player
	PlayID    int `gorm:"primaryKey"`
	Play      *Play
	Score     *float64
	CreatedAt time.Time
	UpdatedAt time.Time
	DeletedAt gorm.DeletedAt `gorm:"index"`
}

type Session

type Session struct {
	ID              int `gorm:"primaryKey"`
	CreatedAt       time.Time
	UpdatedAt       time.Time
	DeletedAt       gorm.DeletedAt `gorm:"index"`
	PlayID          int
	Play            *Play
	GameBelongsToID *int
	GameBelongsTo   *Player `gorm:"foreignKey:GameBelongsToID"`
	StartedAt       time.Time
	FinishedAt      *time.Time
}

type UpdateGame

type UpdateGame struct {
	ID          int     `json:"id"`
	BggID       *int    `json:"bggId"`
	Name        *string `json:"name"`
	Description *string `json:"description"`
}

type UpdatePlayer

type UpdatePlayer struct {
	ID   int     `json:"id"`
	Name *string `json:"name"`
}

type UpdatePlayerPlay

type UpdatePlayerPlay struct {
	PlayerID int      `json:"playerId"`
	PlayID   int      `json:"playId"`
	Score    *float64 `json:"score"`
}

type UpdateSession

type UpdateSession struct {
	ID              int        `json:"id"`
	GameBelongsToID *int       `json:"gameBelongsToId"`
	StartedAt       *time.Time `json:"startedAt"`
	FinishedAt      *time.Time `json:"finishedAt"`
}

Jump to

Keyboard shortcuts

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