Versions in this module Expand all Collapse all v0 v0.9.0 Oct 11, 2022 v0.8.13 Nov 21, 2024 v0.8.12 May 14, 2023 v0.8.11 May 6, 2023 v0.8.10 Feb 26, 2023 v0.8.9 Feb 11, 2023 Changes in this version type TournamentRepository + DeactivatePlayers func(tournamentId string) Found v0.8.8 Feb 7, 2023 v0.8.7 Feb 1, 2023 v0.8.6 Nov 29, 2022 v0.8.5 Nov 12, 2022 v0.8.4 Nov 1, 2022 v0.8.3 Oct 24, 2022 v0.8.2 Oct 20, 2022 v0.8.1 Oct 19, 2022 v0.8.0 Oct 7, 2022 Changes in this version + const DRAW + const LEFT + const RIGHT + type Base struct + CreatedAt time.Time + DeletedAt gorm.DeletedAt + ID uint + UpdatedAt time.Time + func (g *Base) IdAsString() string + type Color struct + Left string + Right string + type Found = bool + type Game struct + LeftPlayerOne TournamentPlayer + LeftPlayerOneID uint + LeftPlayerTwo TournamentPlayer + LeftPlayerTwoID uint + LeftScore int + RightPlayerOne TournamentPlayer + RightPlayerOneID uint + RightPlayerTwo TournamentPlayer + RightPlayerTwoID uint + RightScore int + TournamentTable TournamentTable + TournamentTableID uint + Winner Winner + func NewGame(table *TournamentTable) *Game + func (g *Game) AddLeftTournamentPlayer(p *TournamentPlayer) error + func (g *Game) AddRightTournamentPlayer(p *TournamentPlayer) error + func (g *Game) AddTournamentPlayer(p *TournamentPlayer) error + func (g *Game) GameScore() (uint, uint) + func (g *Game) GetOrCalculateLeftScore() int + func (g *Game) GetOrCalculateRightScore() int + func (g *Game) MarshalJSON() ([]byte, error) + func (g *Game) UpdateScore() error + func (g Game) Left() []Player + func (g Game) LeftPlayerNames() []string + func (g Game) Right() []Player + func (g Game) RightPlayerNames() []string + type GameJson struct + CreatedAt time.Time + LeftPlayers []string + LeftScore int + RightPlayers []string + RightScore int + Table Table + UpdatedAt time.Time + Winner Winner + type GameRepository interface + Find func(id string) (*Game, Found) + FindAll func() []*Game + FindByTournament func(id string) []*Game + Remove func(id string) Found + Store func(game *Game) + type Player struct + CreatedAt time.Time + DeletedAt gorm.DeletedAt + ID uint + Nickname string + RFID string + RealName string + UpdatedAt time.Time + func NewPlayer(nickname, realName string, rfid string) *Player + type PlayerRepository interface + Find func(nickname string) (*Player, Found) + FindAll func() []*Player + FindAllNotInTournament func(id string) []*Player + FindByTournament func(id string) []*Player + Remove func(nickname string) Found + Store func(player *Player) + Update func(player *Player) + type Table struct + Color Color + Name string + func NewTable(name string, color Color) *Table + type TableRepository interface + Find func(id string) (*Table, Found) + FindAll func() []*Table + FindAllNotInTournament func(id string) []*Table + Remove func(id string) Found + Store func(table *Table) + type Tournament struct + GameScore uint + InitialRanking uint + Name string + Timeout uint + func NewTournament(name string) *Tournament + type TournamentPlayer struct + Active bool + Latest *time.Time + Player Player + PlayerID uint + Ranking uint + Tournament Tournament + TournamentID uint + func NewTournamentPlayer(player *Player, tournament *Tournament) *TournamentPlayer + func NewTournamentPlayerWithRanking(player *Player, tournament *Tournament, ranking uint) *TournamentPlayer + type TournamentPlayerHistory struct + DeletedAt gorm.DeletedAt + Ranking uint + TournamentPlayer TournamentPlayer + TournamentPlayerID uint + UpdatedAt time.Time + func NewTournamentPlayerHistory(player *TournamentPlayer) *TournamentPlayerHistory + type TournamentRepository interface + ActivatePlayer func(tournamentId string, nickname string) (*TournamentPlayer, Found) + AddPlayer func(tournamentId string, p *Player) (*TournamentPlayer, Found) + AddPlayerWithRanking func(id string, p *Player, ranking uint) (*TournamentPlayer, Found) + AddTables func(tournamentId string, table *Table) (*TournamentTable, Found) + DeactivatePlayer func(tournamentId string, nickname string) (*TournamentPlayer, Found) + Find func(id string) (*Tournament, Found) + FindAll func() []*Tournament + FindAllActivePlayers func(tournamentId string) ([]*TournamentPlayer, Found) + FindAllTables func(id string) ([]*TournamentTable, Found) + FindPlayer func(tournamentId string, nickname string) (*TournamentPlayer, Found) + FindTable func(tournamentId string, tableId string) (*TournamentTable, Found) + History func(tournamentId string, from time.Time) ([]*TournamentPlayerHistory, Found) + PlayerHistory func(tournamentId string, nickname string, from time.Time) ([]*TournamentPlayerHistory, Found) + RandomGames func(id string) ([]*Game, Found) + Remove func(id string) Found + RemoveTable func(tournamentId string, tableId string) Found + Store func(tournament *Tournament) + Update func(tournament *Tournament) + UpdatePlayerRanking func(tournamentId string, nickname string, gameScore int, updated time.Time) (*TournamentPlayer, Found) + type TournamentTable struct + Table Table + TableID uint + Tournament Tournament + TournamentId uint + func NewTournamentTable(tournament *Tournament, table *Table) *TournamentTable + type Winner string