Documentation ¶
Index ¶
Constants ¶
View Source
const ( // DatasetID is name of BQ dataset. DatasetID = "qs_events" // TableID is name of BQ table. TableID = "task_events" )
Variables ¶
This section is empty.
Functions ¶
func TaskEvents ¶
TaskEvents logs the given TaskEvents to a bigquery table asynchronously.
Types ¶
type AsyncBqInserter ¶
type AsyncBqInserter interface {
Insert(ctx context.Context, rows ...bigquery.ValueSaver) error
}
AsyncBqInserter defines what eventlog package expects from BQ inserting library.
type NullBQInserter ¶
type NullBQInserter struct { }
NullBQInserter implements AsyncBqInserter and just logs "inserted" events.
func (*NullBQInserter) Insert ¶
func (n *NullBQInserter) Insert(ctx context.Context, rows ...bigquery.ValueSaver) error
Insert implements AsyncBqInserter interface.
type RAMBufferedBQInserter ¶
type RAMBufferedBQInserter struct { ProjectID string DatasetID string TableID string // contains filtered or unexported fields }
RAMBufferedBQInserter implements AsyncBqInserter via in-RAM buffering of events for later sending to BQ.
func NewRAMBufferedBQInserter ¶
func NewRAMBufferedBQInserter(ctx context.Context, projectID, datasetID, tableID string) (r *RAMBufferedBQInserter, err error)
NewRAMBufferedBQInserter instantiates new RAMBufferedBQInserter.
func (*RAMBufferedBQInserter) CloseAndDrain ¶
func (r *RAMBufferedBQInserter) CloseAndDrain(ctx context.Context)
CloseAndDrain stops accepting new rows and waits until all buffered rows are sent or provided `ctx` times out.
func (*RAMBufferedBQInserter) Insert ¶
func (r *RAMBufferedBQInserter) Insert(ctx context.Context, rows ...bigquery.ValueSaver) error
Insert implements AsyncBqInserter interface.
Click to show internal directories.
Click to hide internal directories.