Documentation ¶
Index ¶
- type Controller
- type DatabaseOutput
- type DateFile
- type DateInputParameters
- type DateToPath
- type FileOutput
- type FileOutputParameters
- type GameEventsFile
- type GameEventsXMLAction
- type GameEventsXMLAtBat
- type GameEventsXMLGame
- type GameEventsXMLHalfInning
- type GameEventsXMLInning
- type GameEventsXMLPitch
- type GameFile
- type GameXMLGame
- type GameXMLStadium
- type GameXMLTeam
- type ScoreBoardFile
- type ScoreboardXMLGame
- type ScoreboardXMLGameLinescore
- type ScoreboardXMLGameStatus
- type ScoreboardXMLGames
- type ScreenOutput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Controller ¶
type Controller interface { Stop() Init() error Abort() Run() }
Controller is the interface that defines the methods for controlling a pipeline
type DatabaseOutput ¶
type DatabaseOutput struct { DataInput []chan string // contains filtered or unexported fields }
DatabaseOutput contains the elements of a pipeline stage that will accept
strings of data and print them to the screen
func (*DatabaseOutput) Abort ¶
func (dbO *DatabaseOutput) Abort()
Abort the pipeline stage immediately
func (*DatabaseOutput) Stop ¶
func (dbO *DatabaseOutput) Stop()
Stop the pipeline stage in a graceful manner
type DateFile ¶
type DateFile struct { DataInput chan string DataOutput chan string GameFileOutout chan string // contains filtered or unexported fields }
DateFile contains the elements of the stage
func (*DateFile) ChannelListener ¶
ChannelListener should be run in a goroutine and will receive data on the input channel
and the input control channel. The parameters are converted to a slice of time elements and these elements are then sent out over the output channel.
type DateInputParameters ¶
DateInputParameters represents the data that comes into this pipeline stage
type DateToPath ¶
type DateToPath struct { DataInput chan DateInputParameters DataOutput chan string BaseURL string // contains filtered or unexported fields }
DateToPath contains the elements of a pipeline stage that will accept a
set of date inputDataeters and, for each date, a path to the page containing data for that date. Input and output are byte arrays containing marshalled JSON data.
type FileOutput ¶
type FileOutput struct { DataInput []chan string // contains filtered or unexported fields }
FileOutput contains the elements of a pipeline stage that will accept
strings of data and print them to the screen
type FileOutputParameters ¶
FileOutputParameters represents the data that comes into this pipeline stage
type GameEventsFile ¶
type GameEventsFile struct { DataInput chan string DataOutput chan FileOutputParameters // contains filtered or unexported fields }
GameEventsFile contains the elements of the stage
func (*GameEventsFile) ChannelListener ¶
func (gE *GameEventsFile) ChannelListener(client *http.Client)
ChannelListener should be run in a goroutine and will receive data on the input channel
and the input control channel. The parameters are converted to a slice of time elements and these elements are then sent out over the output channel.
func (*GameEventsFile) Init ¶
func (gE *GameEventsFile) Init() error
Init will create all channels and other initialization needs.
The DataInput channel is the output of any previous pipeline stage so it shouldn't be created here
func (*GameEventsFile) Stop ¶
func (gE *GameEventsFile) Stop()
Stop will close the input channel, causing the Channel Listener to stop
type GameEventsXMLAction ¶
type GameEventsXMLAction struct { Balls string `xml:"b,attr"` Strikes string `xml:"s,attr"` Outs string `xml:"o,attr"` EnglishDescription string `xml:"des,attr"` EspañolDescription string `xml:"des_es,attr"` EnglishEvent string `xml:"event,attr"` EspañolEvent string `xml:"event_es,attr"` TFS string `xml:"tfs,attr"` TFSZulu string `xml:"tfs_zulu,attr"` Player string `xml:"player,attr"` Pitch string `xml:"pitch,attr"` EventNumber string `xml:"event_num,attr"` HomeTeamRuns string `xml:"home_team_runs,attr"` AwayTeamRuns string `xml:"away_team_runs,attr"` }
GameEventsXMLAction describes the action structure present in the game_events.xml file
type GameEventsXMLAtBat ¶
type GameEventsXMLAtBat struct { BatterNumber string `xml:"num,attr"` Balls string `xml:"b,attr"` Strikes string `xml:"s,attr"` Outs string `xml:"o,attr"` StartTFS string `xml:"start_tfs,attr"` StartTFSZulu string `xml:"start_tfs_zulu,attr"` Batter string `xml:"batter,attr"` Pitcher string `xml:"pitcher,attr"` EnglishDescription string `xml:"des,attr"` EspañolDescription string `xml:"des_es,attr"` EventNumber string `xml:"event_num,attr"` EnglishEvent string `xml:"event,attr"` EspañolEvent string `xml:"event_es,attr"` PlayGUID string `xml:"play_guid,attr"` Score string `xml:"score,attr"` HomeTeamRuns string `xml:"home_team_runs,attr"` AwayTeamRuns string `xml:"away_team_runs,attr"` FirstBasePlayer string `xml:"b1,attr"` SecondBasePlayer string `xml:"b2,attr"` ThirdBasePlayer string `xml:"b3,attr"` Pitches []GameEventsXMLPitch `xml:"pitch"` }
GameEventsXMLAtBat describes the at-bat structure present in the game_events.xml file
type GameEventsXMLGame ¶
type GameEventsXMLGame struct {
Innings []GameEventsXMLInning `xml:"inning"`
}
GameEventsXMLGame describes the game structure present in the game_events.xml file
type GameEventsXMLHalfInning ¶
type GameEventsXMLHalfInning struct { AtBats []GameEventsXMLAtBat `xml:"atbat"` Actions []GameEventsXMLAction `xml:"action"` }
GameEventsXMLHalfInning describes the half-inning structure present in the game_events.xml file
type GameEventsXMLInning ¶
type GameEventsXMLInning struct { Number string `xml:"num,attr"` TopHalf GameEventsXMLHalfInning `xml:"top"` BottomHalf GameEventsXMLHalfInning `xml:"bottom"` }
GameEventsXMLInning describes the inning structure present in the game_events.xml file
type GameEventsXMLPitch ¶
type GameEventsXMLPitch struct { SVID string `xml:"sv_id,attr"` EnglishDescription string `xml:"des,attr"` EspañolDescription string `xml:"des_es,attr"` Type string `xml:"type,attr"` StartSpeed string `xml:"start_speed,attr"` PitchType string `xml:"pitch_type,attr"` }
GameEventsXMLPitch describes the pitch structure present in the game_events.xml file
type GameFile ¶
type GameFile struct { DataInput chan string DataOutput chan FileOutputParameters // contains filtered or unexported fields }
GameFile contains the elements of the stage
func (*GameFile) ChannelListener ¶
ChannelListener should be run in a goroutine and will receive data on the input channel
and the input control channel. The parameters are converted to a slice of time elements and these elements are then sent out over the output channel.
type GameXMLGame ¶
type GameXMLGame struct { Type string `xml:"type,attr"` LocalGameTime string `xml:"local_game_time,attr"` GamePK string `xml:"game_pk,attr"` GameTimeEastern string `xml:"game_time_et,attr"` GamedaySW string `xml:"gameday_sw,attr"` Teams []GameXMLTeam `xml:"team"` Stadium GameXMLStadium `xml:"stadium"` }
GameXMLGame describes the game structure present in the game.xml file
type GameXMLStadium ¶
type GameXMLStadium struct { ID string `xml:"id,attr"` Name string `xml:"name,attr"` VenueWhoKnows string `xml:"venue_w_chan_loc,attr"` Location string `xml:"location,attr"` }
GameXMLStadium decribes the stadium structure present in the game.xml file
type GameXMLTeam ¶
type GameXMLTeam struct { Type string `xml:"type,attr"` Code string `xml:"code,attr"` FileCode string `xml:"file_code,attr"` Abbreviation string `xml:"abbrev,attr"` ID string `xml:"id,attr"` Name string `xml:"name,attr"` FullName string `xml:"name_full,attr"` BriefName string `xml:"name_brief,attr"` Wins string `xml:"w,attr"` Losses string `xml:"l,attr"` DivisionID string `xml:"division_id,attr"` LeagueID string `xml:"league_id,attr"` League string `xml:"league,attr"` }
GameXMLTeam describes the team structure present in the game.xml file
type ScoreBoardFile ¶
type ScoreBoardFile struct { DataInput chan string DataOutput chan string GameFileOutout chan string BaseURL string Client *http.Client // contains filtered or unexported fields }
ScoreBoardFile contains the elements of the stage
func (*ScoreBoardFile) Init ¶
func (sbF *ScoreBoardFile) Init() error
Init will create all channels and other initialization needs.
The DataInput channel is the output of any previous pipeline stage so it shouldn't be created here
func (*ScoreBoardFile) Run ¶
func (sbF *ScoreBoardFile) Run()
Run should be run in a goroutine and will receive URLs on the input channel.
It will add the scoreboard file (master_scoreboard.xml) to the URL, retrieve it, and then parse it. There will be two kinds of output: 1. Game path and primary key to assist in getting further data about the game 2. Game data contained in the file to be stored for future use
func (*ScoreBoardFile) Stop ¶
func (sbF *ScoreBoardFile) Stop()
Stop will close the input channel, causing the Channel Listener to stop
type ScoreboardXMLGame ¶
type ScoreboardXMLGame struct { ID string `xml:"id,attr"` Venue string `xml:"venue,attr"` PK int `xml:"game_pk,attr"` Time string `xml:"time,attr"` DateTime string `xml:"time_date,attr"` TimeDateAwLg string `xml:"time_date_aw_lg,attr"` TimeDateHmLg string `xml:"time_date_hm_lg,attr"` TimeZone string `xml:"time_zone,attr"` AMPM string `xml:"ampm,attr"` FirstPitchET string `xml:"first_pitch_et,attr"` AwayTime string `xml:"away_time,attr"` AwayTimeZone string `xml:"away_time_zone,attr"` AwayAMPM string `xml:"away_ampm,attr"` HomeTime string `xml:"home_time,attr"` HomeTimeZone string `xml:"home_time_zone,attr"` HomeAMPM string `xml:"home_ampm,attr"` GameType string `xml:"game_type,attr"` TieBreakerSW string `xml:"tiebreaker_sw,attr"` ResumeDate string `xml:"resume_date,attr"` OriginalDate string `xml:"original_date,attr"` TimeZoneAwLg string `xml:"time_zone_aw_lg,attr"` TimeZoneHmLg string `xml:"time_zone_hm_lg,attr"` TimeAwayLg string `xml:"time_aw_lg,attr"` AwLgAMPM string `xml:"aw_lg_ampm,attr"` TzAwLgGen string `xml:"tz_aw_lg_gen,attr"` TimeHmLg string `xml:"time_hm_lg,attr"` HmLgGen string `xml:"hm_lg_gen,attr"` TzHmLgGen string `xml:"tz_hm_lg_gen,attr"` VenueID string `xml:"venue_id,attr"` ScheduledInnings int `xml:"scheduled_innings,attr"` Description string `xml:"description,attr"` AwayNameAbbrev string `xml:"away_name_abbrev,attr"` HomeNameAbbrev string `xml:"home_name_abbrev,attr"` AwayCode string `xml:"away_code,attr"` AwayFileCode string `xml:"away_file_code,attr"` AwayTeamID string `xml:"away_team_id,attr"` AwayTeamCity string `xml:"away_team_city,attr"` AwayTeamName string `xml:"away_team_name,attr"` AwayDivision string `xml:"away_division,attr"` AwayLeagueID string `xml:"away_league_id,attr"` AwaySportCode string `xml:"away_sport_code,attr"` HomeCode string `xml:"home_code,attr"` HomeFileCode string `xml:"home_file_code,attr"` HomeTeamID string `xml:"home_team_id,attr"` HomeTeamCity string `xml:"home_team_city,attr"` HomeTeamName string `xml:"home_team_name,attr"` HomeDivision string `xml:"home_division,attr"` HomeLeagueID string `xml:"home_league_id,attr"` HomeSportCode string `xml:"home_sport_code,attr"` Day string `xml:"day,attr"` GamedaySW string `xml:"gameday_sw,attr"` DoubleHeaderSW string `xml:"double_header_sw,attr"` GameNumber int `xml:"game_nbr,attr"` TBDFlag string `xml:"tbd_flag,attr"` AwayGamesBack string `xml:"away_games_back,attr"` HomeGamesBack string `xml:"home_games_back,attr"` AwayGamesBackWildcard string `xml:"away_games_back_wildcard,attr"` HomeGamesBackWildcard string `xml:"home_games_back_wildcard,attr"` VenueWChanLoc string `xml:"venue_w_chan_loc,attr"` Location string `xml:"location,attr"` GameDay string `xml:"gameday,attr"` AwayWins int `xml:"away_win,attr"` AwayLosses int `xml:"away_loss,attr"` HomeWins int `xml:"home_win,attr"` HomeLosses int `xml:"home_loss,attr"` GameDataDirectory string `xml:"game_data_directory,attr"` League string `xml:"league,attr"` Status ScoreboardXMLGameStatus `xml:"status"` Linescore ScoreboardXMLGameLinescore `xml:"linescore"` }
ScoreboardXMLGame describes the game structure present in the master_scoreboard.xml file
type ScoreboardXMLGameLinescore ¶
type ScoreboardXMLGameLinescore struct { Innings []struct { Away int `xml:"away,attr"` Home int `xml:"home,attr"` } `xml:"inning"` Runs struct { Away int `xml:"away,attr"` Home int `xml:"home,attr"` Diff int `xml:"diff,attr"` } `xml:"r"` Hits struct { Away int `xml:"away,attr"` Home int `xml:"home,attr"` } `xml:"h"` Errors struct { Away int `xml:"away,attr"` Home int `xml:"home,attr"` } `xml:"e"` HR struct { Away int `xml:"away,attr"` Home int `xml:"home,attr"` } `xml:"hr"` SB struct { Away int `xml:"away,attr"` Home int `xml:"home,attr"` } `xml:"sb"` SO struct { Away int `xml:"away,attr"` Home int `xml:"home,attr"` } `xml:"so"` }
ScoreboardXMLGameLinescore describes the inning by inning linescore structure present in the
master_scoreboard.xml file
type ScoreboardXMLGameStatus ¶
type ScoreboardXMLGameStatus struct { Status string `xml:"status,attr"` Ind string `xml:"ind,attr"` Reason string `xml:"reason,attr"` Inning int `xml:"inning,attr"` TopInning string `xml:"top_inning,attr"` Balls int `xml:"b,attr"` Strikes int `xml:"s,attr"` Outs int `xml:"o,attr"` InningState string `xml:"inning_state,attr"` Note string `xml:"note,attr"` Perfect string `xml:"is_perfect_game,attr"` NoHitter string `xml:"is_no_hitter,attr"` }
ScoreboardXMLGameStatus describes the game structure present in the master_scoreboard.xml file
type ScoreboardXMLGames ¶
type ScoreboardXMLGames struct { Year int `xml:"year,attr"` Month int `xml:"month,attr"` Day int `xml:"day,attr"` LastModified string `xml:"modified_date,attr"` NextDay string `xml:"next_day_date,attr"` Games []ScoreboardXMLGame `xml:"game"` }
ScoreboardXMLGames describes the games structure present in the master_scoreboard.xml file
type ScreenOutput ¶
type ScreenOutput struct { DataInput []chan string // contains filtered or unexported fields }
ScreenOutput contains the elements of a pipeline stage that will accept
strings of data and print them to the screen
func (*ScreenOutput) Stop ¶
func (sO *ScreenOutput) Stop()
Stop the pipeline stage in a graceful manner