Documentation ¶
Index ¶
- func DeleteByUUID(uuid uuid.UUID) bool
- func YellowDaysInSeason(yellowPeriods []YellowPeriod, season int) map[uuid.UUID]int
- type Absentee
- type Bet
- type BountyHunters
- type ByAvgPlace
- type ByBestPlayer
- type ByHeadsUp
- type ByKnockouts
- type ByNumPlayed
- type ByPoints
- type ByWinRatio
- type ByWinRatioTotal
- type ByWinnings
- type ByWinningsOld
- type Info
- type MonthStats
- type PeriodStats
- type PlayerResult
- type PlayerResults
- type PlayerStanding
- type PlayerStandings
- func (s PlayerStandings) ByAvgPlace()
- func (s PlayerStandings) ByBestPlayer()
- func (s PlayerStandings) ByHeadsUp()
- func (s PlayerStandings) ByKnockouts()
- func (s PlayerStandings) ByNumPlayed()
- func (s PlayerStandings) ByPoints()
- func (s PlayerStandings) ByWinRatio()
- func (s PlayerStandings) ByWinRatioTotal()
- func (s PlayerStandings) ByWinnings(oldTieBreak bool)
- func (s PlayerStandings) ByWorstPlayer()
- func (existingPS PlayerStandings) Combine(newPS PlayerStandings) PlayerStandings
- func (s PlayerStandings) Duplicate() PlayerStandings
- func (s PlayerStandings) Len() int
- func (s PlayerStandings) Swap(i, j int)
- type RedisTournamentStorage
- func (rts *RedisTournamentStorage) Delete(uuid uuid.UUID) error
- func (rts *RedisTournamentStorage) Load(uuid uuid.UUID) (*Tournament, error)
- func (rts *RedisTournamentStorage) LoadAll() (Tournaments, error)
- func (rts *RedisTournamentStorage) LoadBySeason(season int) (Tournaments, error)
- func (rts *RedisTournamentStorage) Store(t *Tournament) error
- type Result
- type SeasonTitles
- type SortedStandings
- type Tournament
- func (t *Tournament) AddNoShow(player uuid.UUID, reason string) error
- func (t *Tournament) RemoveNoShow(player uuid.UUID) error
- func (t *Tournament) SetBountyHunters(bh BountyHunters) error
- func (t *Tournament) SetPlayed(isPlayed bool) error
- func (t *Tournament) SetResult(result Result) error
- func (t *Tournament) UpdateInfo(tdata Info) error
- type TournamentStorage
- type Tournaments
- type YellowPeriod
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeleteByUUID ¶
func YellowDaysInSeason ¶
func YellowDaysInSeason(yellowPeriods []YellowPeriod, season int) map[uuid.UUID]int
Types ¶
type ByAvgPlace ¶
type ByAvgPlace struct{ PlayerStandings }
func (ByAvgPlace) Less ¶
func (s ByAvgPlace) Less(i, j int) bool
type ByBestPlayer ¶
type ByBestPlayer struct{ PlayerStandings }
func (ByBestPlayer) Less ¶
func (s ByBestPlayer) Less(i, j int) bool
type ByHeadsUp ¶
type ByHeadsUp struct{ PlayerStandings }
type ByKnockouts ¶
type ByKnockouts struct{ PlayerStandings }
func (ByKnockouts) Less ¶
func (s ByKnockouts) Less(i, j int) bool
type ByNumPlayed ¶
type ByNumPlayed struct{ PlayerStandings }
func (ByNumPlayed) Less ¶
func (s ByNumPlayed) Less(i, j int) bool
type ByPoints ¶
type ByPoints struct{ PlayerStandings }
type ByWinRatio ¶
type ByWinRatio struct{ PlayerStandings }
func (ByWinRatio) Less ¶
func (s ByWinRatio) Less(i, j int) bool
type ByWinRatioTotal ¶
type ByWinRatioTotal struct{ PlayerStandings }
func (ByWinRatioTotal) Less ¶
func (s ByWinRatioTotal) Less(i, j int) bool
type ByWinnings ¶
type ByWinnings struct{ PlayerStandings }
func (ByWinnings) Less ¶
func (s ByWinnings) Less(i, j int) bool
type ByWinningsOld ¶
type ByWinningsOld struct{ PlayerStandings }
Implements old tie break used in earlier seasons
func (ByWinningsOld) Less ¶
func (s ByWinningsOld) Less(i, j int) bool
type MonthStats ¶
type PeriodStats ¶
type PeriodStats struct { YellowPeriods []YellowPeriod `json:"yellowPeriods"` MonthStats []*MonthStats `json:"monthStats"` }
func SeasonStats ¶
func SeasonStats(seasons []int) *PeriodStats
type PlayerResult ¶
type PlayerResults ¶
type PlayerResults []PlayerResult
func (PlayerResults) BetterThan ¶
func (s PlayerResults) BetterThan(t PlayerResults) bool
func (PlayerResults) Equals ¶
func (s PlayerResults) Equals(t PlayerResults) bool
func (PlayerResults) Len ¶
func (s PlayerResults) Len() int
func (PlayerResults) Less ¶
func (s PlayerResults) Less(i, j int) bool
func (PlayerResults) Swap ¶
func (s PlayerResults) Swap(i, j int)
type PlayerStanding ¶
type PlayerStanding struct { Player uuid.UUID `json:"uuid"` Results PlayerResults `json:"results"` Winnings int `json:"winnings"` AvgPlace float64 `json:"avgPlace"` Points int `json:"points"` NumHeadsUp int `json:"headsUp"` NumWins int `json:"wins"` NumPlayed int `json:"played"` Enough bool `json:"playedEnough"` NumTotal int `json:"numTotal"` Knockouts int `json:"knockouts"` }
func (*PlayerStanding) Equals ¶
func (s *PlayerStanding) Equals(t *PlayerStanding) bool
type PlayerStandings ¶
type PlayerStandings []*PlayerStanding
func BestPlayer ¶
func BestPlayer(tournaments Tournaments) (PlayerStandings, bool)
func BountyHunter ¶
func BountyHunter(tournaments Tournaments) (PlayerStandings, bool)
func NewStandings ¶
func NewStandings(tournaments Tournaments) PlayerStandings
TODO: Split into smaller functions
func WorstPlayer ¶
func WorstPlayer(tournaments Tournaments) (PlayerStandings, bool)
func (PlayerStandings) ByAvgPlace ¶
func (s PlayerStandings) ByAvgPlace()
func (PlayerStandings) ByBestPlayer ¶
func (s PlayerStandings) ByBestPlayer()
func (PlayerStandings) ByHeadsUp ¶
func (s PlayerStandings) ByHeadsUp()
func (PlayerStandings) ByKnockouts ¶
func (s PlayerStandings) ByKnockouts()
func (PlayerStandings) ByNumPlayed ¶
func (s PlayerStandings) ByNumPlayed()
func (PlayerStandings) ByPoints ¶
func (s PlayerStandings) ByPoints()
func (PlayerStandings) ByWinRatio ¶
func (s PlayerStandings) ByWinRatio()
func (PlayerStandings) ByWinRatioTotal ¶
func (s PlayerStandings) ByWinRatioTotal()
func (PlayerStandings) ByWinnings ¶
func (s PlayerStandings) ByWinnings(oldTieBreak bool)
func (PlayerStandings) ByWorstPlayer ¶
func (s PlayerStandings) ByWorstPlayer()
func (PlayerStandings) Combine ¶
func (existingPS PlayerStandings) Combine(newPS PlayerStandings) PlayerStandings
func (PlayerStandings) Duplicate ¶
func (s PlayerStandings) Duplicate() PlayerStandings
func (PlayerStandings) Len ¶
func (s PlayerStandings) Len() int
func (PlayerStandings) Swap ¶
func (s PlayerStandings) Swap(i, j int)
type RedisTournamentStorage ¶
type RedisTournamentStorage struct {
// contains filtered or unexported fields
}
func NewRedisTournamentStorage ¶
func NewRedisTournamentStorage() *RedisTournamentStorage
func (*RedisTournamentStorage) Delete ¶
func (rts *RedisTournamentStorage) Delete(uuid uuid.UUID) error
func (*RedisTournamentStorage) Load ¶
func (rts *RedisTournamentStorage) Load(uuid uuid.UUID) (*Tournament, error)
func (*RedisTournamentStorage) LoadAll ¶
func (rts *RedisTournamentStorage) LoadAll() (Tournaments, error)
func (*RedisTournamentStorage) LoadBySeason ¶
func (rts *RedisTournamentStorage) LoadBySeason(season int) (Tournaments, error)
func (*RedisTournamentStorage) Store ¶
func (rts *RedisTournamentStorage) Store(t *Tournament) error
type SeasonTitles ¶
type SeasonTitles struct { Season int `json:"season"` Champion struct { Uuid uuid.UUID `json:"uuid"` Winnings int `json:"winnings"` } `json:"champion"` AvgPlaceWinner struct { Uuid uuid.UUID `json:"uuid"` AvgPlace float64 `json:"avgPlace"` } `json:"avgPlaceWinner"` PointsWinner struct { Uuid uuid.UUID `json:"uuid"` Points int `json:"points"` } `json:"pointsWinner"` MostYellowDays struct { Uuid uuid.UUID `json:"uuid"` Days int `json:"days"` } `json:"mostYellowDays"` PlayerOfTheYear struct { Uuid uuid.UUID `json:"uuid"` Months int `json:"months"` } `json:"playerOfTheYear"` LoserOfTheYear struct { Uuid uuid.UUID `json:"uuid"` Months int `json:"months"` } `json:"loserOfTheYear"` BountyWinner struct { Uuid uuid.UUID `json:"uuid"` Knockouts int `json:"knockouts"` } `json:"bountyWinner"` }
func Titles ¶
func Titles(seasons []int) []*SeasonTitles
type SortedStandings ¶
type SortedStandings struct { ByWinnings PlayerStandings `json:"byWinnings"` ByAvgPlace PlayerStandings `json:"byAvgPlace"` ByPoints PlayerStandings `json:"byPoints"` ByHeadsUp PlayerStandings `json:"byHeadsUp"` ByWinRatio PlayerStandings `json:"byWinRatio"` ByWinRatioTotal PlayerStandings `json:"byWinRatioTotal"` ByNumPlayed PlayerStandings `json:"byNumPlayed"` ByKnockouts PlayerStandings `json:"byKnockouts"` }
func SeasonStandings ¶
func SeasonStandings(season int) *SortedStandings
func TotalStandings ¶
func TotalStandings(seasons []int) *SortedStandings
type Tournament ¶
type Tournament struct { UUID uuid.UUID `json:"uuid"` Info Info `json:"info"` Noshows []Absentee `json:"noshows"` Result Result `json:"result"` Played bool `json:"played"` Moved bool `json:"moved"` Bets []Bet `json:"bets"` BountyHunters BountyHunters `json:"bountyHunters"` }
func TournamentByUUID ¶
func TournamentByUUID(uuid uuid.UUID) (*Tournament, error)
func (*Tournament) AddNoShow ¶
func (t *Tournament) AddNoShow(player uuid.UUID, reason string) error
func (*Tournament) RemoveNoShow ¶
func (t *Tournament) RemoveNoShow(player uuid.UUID) error
func (*Tournament) SetBountyHunters ¶
func (t *Tournament) SetBountyHunters(bh BountyHunters) error
func (*Tournament) SetPlayed ¶
func (t *Tournament) SetPlayed(isPlayed bool) error
func (*Tournament) SetResult ¶
func (t *Tournament) SetResult(result Result) error
func (*Tournament) UpdateInfo ¶
func (t *Tournament) UpdateInfo(tdata Info) error
type TournamentStorage ¶
type TournamentStorage interface { Store(*Tournament) error Delete(uuid.UUID) error Load(uuid.UUID) (*Tournament, error) LoadAll() (Tournaments, error) LoadBySeason(int) (Tournaments, error) }
A storage interface for Tournaments
type Tournaments ¶
type Tournaments []*Tournament
func AllTournaments ¶
func AllTournaments() (Tournaments, error)
func TournamentsByPeriod ¶
func TournamentsBySeason ¶
func TournamentsBySeason(season int) (Tournaments, error)
func (Tournaments) GroupByMonths ¶
func (t Tournaments) GroupByMonths(season int) map[time.Month]Tournaments
func (Tournaments) Len ¶
func (t Tournaments) Len() int
func (Tournaments) Less ¶
func (t Tournaments) Less(i, j int) bool
func (Tournaments) Played ¶
func (t Tournaments) Played() Tournaments
func (Tournaments) Seasons ¶
func (t Tournaments) Seasons() []int
func (Tournaments) Swap ¶
func (t Tournaments) Swap(i, j int)
type YellowPeriod ¶
type YellowPeriod struct { From time.Time `json:"from"` To time.Time `json:"to"` Player uuid.UUID `json:"uuid"` Active bool `json:"active"` }
func YellowPeriods ¶
func YellowPeriods(tournaments Tournaments) []YellowPeriod
Click to show internal directories.
Click to hide internal directories.