Documentation ¶
Index ¶
- func Countries(ts []Tournament) []string
- func Divisions(ts []Tournament) []string
- func Names(ts []Tournament) []string
- func ScoresFromRecord(r []string, start int) []int8
- func ScoresToRecord(scores []int8) []string
- func Series(ts []Tournament) []string
- type Game
- type Games
- func (gs *Games) Add(g Game, sorted bool)
- func (gs *Games) AddBulk(games []Game)
- func (gs Games) AddFromRecords(records [][]string) Games
- func (gs Games) Categories() []string
- func (gs Games) Dates() []string
- func (gs Games) Firstnames() []string
- func (gs Games) Lastnames() []string
- func (gs Games) Len() int
- func (gs Games) Less(i, j int) bool
- func (gs Games) Rounds() []string
- func (gs Games) Swap(i, j int)
- func (gs Games) Tournaments() []Tournament
- func (gs *Games) Update(index int, g Game)
- type Tournament
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Countries ¶
func Countries(ts []Tournament) []string
Countries returns a list of tournament countries without duplicates
func Divisions ¶
func Divisions(ts []Tournament) []string
Divisions returns a list of tournament divisions without duplicates
func Names ¶
func Names(ts []Tournament) []string
Names returns a list of tournament names without duplicates
func ScoresFromRecord ¶
func ScoresToRecord ¶
func Series ¶
func Series(ts []Tournament) []string
Series returns a list of tournament series without duplicates
Types ¶
type Game ¶
type Game struct { Country string Name string Serie string Division string Date string Round string Category string Teams uint8 Players []string Sets uint8 Scores []int8 }
Game represents tournament game and a csv line in the file
func NewFromRecord ¶
NewFromRecord creates a new Game from a csv line in this case a []string. It is the opposite of ToRecord.
func (Game) Compare ¶
Compare returns -1 if g is less than other, 0 if equals and +1 if greater than other The order is: Country, Name, Serie, Division, Category, Round, Date Players and Scores are not compared
func (Game) IsTournament ¶
func (g Game) IsTournament(t Tournament) bool
IsTournament returns true if the game is part of the tournament
func (Game) ToRecord ¶
ToRecord returns a csv line in this case a []string. It is the opposite of NewFromRecord.
func (Game) Tournament ¶
func (g Game) Tournament() Tournament
Tournament returns the tournament of the game
type Games ¶
type Games []Game
Games is a collections of games and methods to manipulate the collection
func (Games) AddFromRecords ¶
AddFromRecords reads csv records and creates a collection of games wihout duplicates
func (Games) Categories ¶
Categories return a list without duplicates of all the categories in Games
func (Games) Firstnames ¶
Firstnames returns a list without duplicates of all the last names in Games
func (Games) Tournaments ¶
func (gs Games) Tournaments() []Tournament
Tournaments returns a list of tournaments without duplicates