Documentation ¶
Index ¶
- func CalculateHash(o interface{}) (string, error)
- func ComputePlayerId(firstName, lastName string, birthDate time.Time) (string, error)
- func GenerateGameId(year, gameNumber int) string
- func HashString(s string) string
- type BoxScoreTeams
- type Boxscore
- type BoxscorePlayerStats
- type GameResult
- type GameStatus
- type GameStatusId
- type GameType
- type GameWinner
- type InjuryDetails
- type InjuryStatus
- type LineScore
- type LineScores
- type Player
- type PlayerStats
- type PlayerStub
- type Position
- type Schedule
- type ScheduleGame
- type Score
- type Scoreboard
- type ScoreboardGame
- type Team
- type TeamStats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculateHash ¶
func ComputePlayerId ¶
func GenerateGameId ¶
func HashString ¶
Types ¶
type BoxScoreTeams ¶
type BoxScoreTeams struct { Away Team `json:"away"` AwayStats []BoxscorePlayerStats `json:"away_stats"` Home Team `json:"home"` HomeStats []BoxscorePlayerStats `json:"home_stats"` }
type Boxscore ¶
type Boxscore struct { GameId string `json:"game_id"` Year int `json:"year"` Week int `json:"week"` DateUpdated time.Time `json:"date_updated"` SourceGameId string `json:"source_game_id"` SourceName string `json:"source_name"` DateStart time.Time `json:"date_start"` Status GameStatus `json:"status"` Score LineScores `json:"score"` Attendance int `json:"attendance"` Teams BoxScoreTeams `json:"teams"` TeamStats []struct { Away TeamStats `json:"away"` Home TeamStats `json:"home"` } `json:"team_stats"` }
func CreateBoxScore ¶
func CreateBoxScore( gameId string, sourceGameId string, sourceName string, dateStart time.Time, status GameStatus, score LineScores, teams BoxScoreTeams, teamStats []struct { Away TeamStats `json:"away"` Home TeamStats `json:"home"` }, attendance int, ) Boxscore
type BoxscorePlayerStats ¶
type BoxscorePlayerStats struct { PlayerId string `json:"player_id"` GameId string `json:"game_id"` SourceName string `json:"source_name"` SourcePlayerId string `json:"source_player_id"` SourceGameId string `json:"source_game_id"` Team Team `json:"team"` Opponent Team `json:"opponent"` Name string `json:"name"` Stats PlayerStats `json:"stats"` DateUpdated time.Time `json:"date_updated"` }
type GameResult ¶
type GameResult struct { GameId string `json:"game_id"` Year int `json:"year"` Week int `json:"week"` DateStart time.Time `json:"date_start"` Status GameStatus `json:"game_status"` Away Team `json:"away"` Home Team `json:"home"` AwayScore int `json:"away_score"` HomeScore int `json:"home_score"` Winner GameWinner `json:"winner"` DateUpdated time.Time `json:"date_updated"` }
func GameResultFromBox ¶
func GameResultFromBox(boxscore Boxscore) GameResult
type GameStatus ¶
type GameStatus struct { StatusId GameStatusId `json:"status_id"` IsActive bool `json:"is_active"` HasStarted bool `json:"has_started"` Quarter int `json:"quarter"` Minutes int `json:"minutes"` Seconds int `json:"seconds"` Down int `json:"down"` YardsToGo int `json:"yards_to_go"` }
func CreateGameStatus ¶
func CreateGameStatus(statusId GameStatusId) GameStatus
type GameStatusId ¶
type GameStatusId string
const ( GameStatusId_PreGame GameStatusId = "pre_game" GameStatusId_InProgress GameStatusId = "in_progress" GameStatusId_Final GameStatusId = "final" GameStatusId_Postponed GameStatusId = "postponed" GameStatusId_Cancelled GameStatusId = "cancelled" )
type GameWinner ¶
type GameWinner string
const ( NoResult GameWinner = "no_result" AwayGameWinner GameWinner = "away" HomeGameWinner GameWinner = "home" TieGameWinner GameWinner = "tie" )
type InjuryDetails ¶
type InjuryDetails struct { StatusId InjuryStatus `json:"status_id"` Text string `json:"text"` LastUpdated time.Time `json:"last_updated"` Injury string `json:"injury"` }
type InjuryStatus ¶
type InjuryStatus string
const ( InjuryStatusProbable InjuryStatus = "probable" InjuryStatusQuestionable InjuryStatus = "questionable" InjuryStatusOut InjuryStatus = "out" InjuryStatusInjuredSix InjuryStatus = "six-game" )
type LineScores ¶
type Player ¶
type Player struct { PlayerId string `json:"player_id"` DateUpdated time.Time `json:"date_updated"` FirstName string `json:"first_name"` LastName string `json:"last_name"` FullName string `json:"full_name"` BirthDate time.Time `json:"birth_date"` BirthPlace string `json:"birth_place"` Height string `json:"height"` Weight int `json:"weight"` CanadianPlayer bool `json:"canadian_player"` Position Position `json:"position"` Team Team `json:"team"` IsFreeAgent bool `json:"is_free_agent"` AlternateComputedIds []string `json:"alternate_computed_ids"` Uniform string `json:"uniform"` School string `json:"school"` Season int `json:"season"` InjuryStatus *InjuryDetails `json:"injury_status"` SourceName string `json:"source_name"` SourceId string `json:"source_id"` }
func CreatePlayer ¶
type PlayerStats ¶
type PlayerStats struct { PassAttempts int `json:"pass_attempts"` PassCompletions int `json:"pass_completions"` PassNetYards int `json:"pass_net_yards"` PassLong int `json:"pass_long"` PassTouchdowns int `json:"pass_touchdowns"` PassLongTouchdowns int `json:"pass_long_touchdowns"` PassInterceptions int `json:"pass_interceptions"` RushAttempts int `json:"rush_attempts"` RushNetYards int `json:"rush_net_yards"` RushLong int `json:"rush_long"` RushTouchdowns int `json:"rush_touchdowns"` RushLongTouchdowns int `json:"rush_long_touchdowns"` ReceiveAttempts int `json:"receive_attempts"` ReceiveCaught int `json:"receive_caught"` ReceiveYards int `json:"receive_yards"` ReceiveLong int `json:"receive_long"` ReceiveTouchdowns int `json:"receive_touchdowns"` ReceiveLongTouchdowns int `json:"receive_long_touchdowns"` ReceiveYardsAfterCatch int `json:"receive_yards_after_catch"` Fumbles int `json:"fumbles"` FumblesLost int `json:"fumbles_lost"` Punts int `json:"punts"` PuntGrossYards int `json:"punt_gross_yards"` PuntNetYards int `json:"punt_net_yards"` PuntLong int `json:"punt_long"` PuntSingles int `json:"punt_singles"` PuntsBlocked int `json:"punts_blocked"` PuntsIn10 int `json:"punts_in_10"` PuntsIn20 int `json:"punts_in_20"` PuntsReturned int `json:"punts_returned"` KickReturns int `json:"kick_returns"` KickReturnsYards int `json:"kick_returns_yards"` KickReturnsTouchdowns int `json:"kick_returns_touchdowns"` KickReturnsLong int `json:"kick_returns_long"` KickReturnsTouchdownsLong int `json:"kick_returns_touchdowns_long"` FieldGoalAttempts int `json:"field_goal_attempts"` FieldGoalMade int `json:"field_goal_made"` FieldGoalMisses int `json:"field_goal_misses"` FieldGoalYards int `json:"field_goal_yards"` FieldGoalSingles int `json:"field_goal_singles"` FieldGoalLong int `json:"field_goal_long"` FieldGoalPoints int `json:"field_goal_points"` MissedFieldGoalReturns int `json:"missed_field_goal_returns"` MissedFieldGoalReturnsYards int `json:"missed_field_goal_returns_yards"` MissedFieldGoalReturnsTouchdowns int `json:"missed_field_goal_returns_touchdowns"` MissedFieldGoalReturnsLong int `json:"missed_field_goal_returns_long"` MissedFieldGoalReturnsTouchdownsLong int `json:"missed_field_goal_returns_touchdowns_long"` PuntReturns int `json:"punt_returns"` PuntReturnsYards int `json:"punt_returns_yards"` PuntReturnsTouchdowns int `json:"punt_returns_touchdowns"` PuntReturnsLong int `json:"punt_returns_long"` PuntReturnsTouchdownsLong int `json:"punt_returns_touchdowns_long"` Kicks int `json:"kicks"` KickYards int `json:"kick_yards"` KicksNetYards int `json:"kicks_net_yards"` KicksLong int `json:"kicks_long"` KicksSingles int `json:"kicks_singles"` KicksOutOfEndZone int `json:"kicks_out_of_end_zone"` KicksOnside int `json:"kicks_onside"` OnePointConvertsAttempts int `json:"one_point_converts_attempts"` OnePointConvertsMade int `json:"one_point_converts_made"` TwoPointConvertsMade int `json:"two_point_converts_made"` TacklesTotal int `json:"tackles_total"` TacklesDefensive int `json:"tackles_defensive"` TacklesSpecialTeams int `json:"tackles_special_teams"` SacksQbMade int `json:"sacks_qb_made"` Interceptions int `json:"interceptions"` InterceptionYards int `json:"interceptions_yards"` InterceptionTouchdowns int `json:"interception_touchdowns"` InterceptionLong int `json:"interception_long"` InterceptionTouchdownsLong int `json:"interception_touchdowns_long"` FumblesForced int `json:"fumbles_forced"` FumblesRecovered int `json:"fumbles_recovered"` PassesKnockedDown int `json:"passes_knocked_down"` }
func (PlayerStats) Add ¶
func (ps PlayerStats) Add(other PlayerStats) PlayerStats
type PlayerStub ¶
type PlayerStub struct { PlayerId string `json:"player_id"` FirstName string `json:"first_name"` LastName string `json:"last_name"` BirthDate time.Time `json:"birth_date"` IsFreeAgent bool `json:"is_free_agent"` LastUpdated time.Time `json:"last_updated"` SourceName string `json:"source_name"` SourceId string `json:"source_id"` AlternateComputedIds []string `json:"alternate_computed_ids"` }
type Position ¶
func PositionFromId ¶
type Schedule ¶
type Schedule struct { Year int `json:"year"` DateUpdated time.Time `json:"date_updated"` SourceName string `json:"source_name"` Games []ScheduleGame `json:"games"` }
func CreateSchedule ¶
type ScheduleGame ¶
type ScheduleGame struct { Year int `json:"year"` Week int `json:"week"` GameId string `json:"game_id"` SourceName string `json:"source_name"` SourceId string `json:"source_id"` DateStart time.Time `json:"date_start"` GameNumber int `json:"game_number"` GameType GameType `json:"game_type"` Away Team `json:"away"` Home Team `json:"home"` }
type Scoreboard ¶
type Scoreboard struct { Year int `json:"year"` Week int `json:"week"` DateUpdated time.Time `json:"date_updated"` Games []ScoreboardGame `json:"games"` }
func CreateScoreboard ¶
func CreateScoreboard(year, week int, games []ScoreboardGame) Scoreboard
type ScoreboardGame ¶
type ScoreboardGame struct { Year int `json:"year"` Week int `json:"week"` GameId string `json:"game_id"` DateStart time.Time `json:"date_start"` DateUpdated time.Time `json:"date_updated"` Away Team `json:"away"` Home Team `json:"home"` AwayScore int `json:"away_score"` HomeScore int `json:"home_score"` Winner GameWinner `json:"winner"` GameStatus GameStatus `json:"game_status"` }
type Team ¶
type Team struct { Location string `json:"location"` Name string `json:"name"` Abbr string `json:"abbr"` }
func TeamFreeAgents ¶
func TeamFreeAgents() Team
func TeamFromAbbr ¶
func (Team) IsFreeAgent ¶
type TeamStats ¶
type TeamStats struct { TotalFirstDowns int `json:"total_first_downs"` Rushes int `json:"rushes"` RushYards int `json:"rush_yards"` RushTouchdowns int `json:"rush_touchdowns"` PassAttempts int `json:"pass_attempts"` PassCompletions int `json:"pass_completions"` PassGrossYards int `json:"pass_gross_yards"` PassTouchdowns int `json:"pass_touchdowns"` PassInterceptions int `json:"pass_interceptions"` QbRating string `json:"qb_rating"` SacksTaken int `json:"sacks_taken"` TotalGrossYards int `json:"total_gross_yards"` TimesFumbled int `json:"times_fumbled"` FumblesLost int `json:"fumbles_lost"` Turnovers int `json:"turnovers"` Penalties int `json:"penalties"` PenaltyYards int `json:"penalty_yards"` }
Click to show internal directories.
Click to hide internal directories.