Documentation ¶
Index ¶
- func CreateGameStatsTable()
- func CreateHitsTable()
- func CreatePitchesTable()
- func CreatePlayersTable()
- func CreateTables()
- func ImportGameStatsForTeamAndYears(teamCode string, years []int)
- func ImportHitsForTeamAndYears(teamCode string, years []int)
- func ImportPitchesForTeamAndYears(teamCode string, years []int)
- func ImportPlayersForTeamAndYears(teamCode string, years []int)
- type GameStats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateGameStatsTable ¶
func CreateGameStatsTable()
CreateGameStatsTable creates the hits table and associated indexes. This will drop things if they already exist, causing data loss.
func CreateHitsTable ¶
func CreateHitsTable()
CreateHitsTable creates the hits table and associated indexes. This will drop things if they already exist, causing data loss.
func CreatePitchesTable ¶
func CreatePitchesTable()
CreatePitchesTable creates the pitches table and associated indexes. This will drop things if they already exist, causing data loss.
func CreatePlayersTable ¶
func CreatePlayersTable()
CreatePlayersTable creates the players table and associated indexes. This will drop things if they already exist, causing data loss.
func CreateTables ¶
func CreateTables()
CreateTables creates the database tables used by the importer. For now it's just the pitches table. This will drop tables if they already exist.
func ImportGameStatsForTeamAndYears ¶
ImportGameStatsForTeamAndYears saves game stats fields for a team and season in the game_stats table.
func ImportHitsForTeamAndYears ¶
ImportHitsForTeamAndYears saves all hit data fields for a team and season in the hits table.
func ImportPitchesForTeamAndYears ¶
ImportPitchesForTeamAndYears saves all pitch data fields for a team and season.
func ImportPlayersForTeamAndYears ¶
ImportPlayersForTeamAndYears saves all player data fields for a team and season.
Types ¶
type GameStats ¶
type GameStats struct { StatsTeamCode string Game *gamedayapi.Game StatsTeamWon bool ExtraInningLoss bool WalkOffLoss bool }
func GameStatsFor ¶
func GameStatsFor(statsTeamCode string, game *gamedayapi.Game) *GameStats