Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Match ¶
type Match struct {
ID int
HomeTeam string
AwayTeam string
HomeTeamGoals int
AwayTeamGoals int
MatchWeek int
Season string
Played bool
// contains filtered or unexported fields
}
Match data model
type PointsSorter ¶
type PointsSorter []*TeamSeason
PointsSorter sorts an array of teams by total points
func (PointsSorter) Len ¶
func (a PointsSorter) Len() int
func (PointsSorter) Less ¶
func (a PointsSorter) Less(i, j int) bool
func (PointsSorter) Swap ¶
func (a PointsSorter) Swap(i, j int)
type SimWeekRequest ¶
SimWeekRequest is a json request to sim all matches in a season/week
type TeamSeason ¶
type TeamSeason struct {
ID int
Season string
GamesWon int
GamesLost int
GamesDrawn int
GoalsScored int
GoalsAllowed int
TeamID string
// contains filtered or unexported fields
}
TeamSeason for Instert
func (*TeamSeason) AddResult ¶
func (t *TeamSeason) AddResult(goalsFor, goalsAgainst int)
AddResult updates a teams record and Goals
func (TeamSeason) TotalPoints ¶
func (t TeamSeason) TotalPoints() int
TotalPoints converts record to league points
type TeamSeasonJoin ¶
type TeamSeasonJoin struct {
Team
TeamSeason
}
TeamSeasonJoin data model
func NewTeamSeasonJoin ¶
func NewTeamSeasonJoin(id int, abv, name, season string) TeamSeasonJoin
NewTeamSeasonJoin returns a new team season with team variables
Click to show internal directories.
Click to hide internal directories.