Documentation ¶
Overview ¶
Package bigquery_aggregator uploads data to BigQuery. State is stored in Datastore to prevent duplicate uploads. The aggregator is threadsafe, using Datastore transactions to manage ownership of each uploaded item.
This API is unstable.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Aggregator ¶
type Aggregator struct {
// contains filtered or unexported fields
}
Aggregator aggregates data into a BigQuery table. It is illegal to construct an instance directly. Use the New constructor instead.
func New ¶
New returns an aggregator configured with the given namespace and datastore backend. The datastore is used as a lockservice for preventing duplicate rows. If namespace is empty, then the global namespace will be used.
func (*Aggregator) MatchExists ¶
MatchExists returns true if the match ID for the given region is already stored.
func (*Aggregator) SaveMatches ¶
func (a *Aggregator) SaveMatches(ctx context.Context, matches []data_aggregation.Match) error
SaveMatches stores the match from the given region. Returns whether the function stored the match. If not, and there was no error, then the match was already cached.