Documentation ¶
Overview ¶
Package cache saves data from the esports API into BigQuery.
Most users should use the update_esports_cache command instead of calling this API directly.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cache ¶
type Cache struct { // EntityNamespace is the namespace used when saving datastore entities. By // default, this is constructed with the empty string, which represents the // default namespace. The parameter can be set immediately after calling New. EntityNamespace string // contains filtered or unexported fields }
Cache represents a copy of the esports API data stored on Google Cloud. It is illegal to construct an instance directly. Use New to return a valid instance.
func New ¶
New returns a Cache. doneEntity is the datastore entity name used to track whether a game was cached.
func (Cache) MaybeCreateDatasetAndTable ¶
MaybeCreateDatasetAndTable attempts to create the dataset containing the given table, as well as the table itself.
func (Cache) UploadNewGames ¶
UploadNewGames queries for all games in the given league and tournament title and uploads new games to BigQuery using the configured uploader. The table must exist. Call MaybeCreateDatasetAndTable to attempt the table creation.
type Game ¶
type Game struct { // LeagueName is the league in which the game took place. LeagueName string // TournamentTitle is the title of the tournament where the game took place. TournamentTitle string // BracketName is the name of the bracket where the game took place. BracketName string // MatchName is the name of the match where the game took place. For example, // a match may consists of a best of five between two teams. MatchName string // Game is the summary view of the game. Game *apiclient.Match // GameTimeline is the timeline view of the game. GameTimeline *apiclient.MatchTimeline }
Game is a serialized version of a specific game.