groupexporter

package
v0.0.0-...-ff9afc2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2024 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Overview

Package groupexporter provides functions to export grouped changepoints to BigQuery.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ChangepointKey

func ChangepointKey(cp *changepoints.ChangepointDetailRow) string

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client provides methods to export grouped changepoint rows to BigQuery via the BigQuery Write API.

func NewClient

func NewClient(ctx context.Context, projectID string) (s *Client, reterr error)

NewClient creates a new client for exporting grouped changepoints via the BigQuery Write API. projectID is the project ID of the GCP project.

func (*Client) Close

func (s *Client) Close() (reterr error)

Close releases resources held by the client.

func (*Client) Insert

func (s *Client) Insert(ctx context.Context, rows []*bqpb.GroupedChangepointRow) error

Insert inserts the given rows in BigQuery.

type Exporter

type Exporter struct {
	// contains filtered or unexported fields
}

Exporter provides methods to batch insert grouped changepoint row to BigQuery.

func NewExporter

func NewExporter(client InsertClient) *Exporter

NewExporter instantiates a new Exporter. The given client is used to insert rows into BigQuery.

func (*Exporter) Export

func (e *Exporter) Export(ctx context.Context, groups [][]*changepoints.ChangepointDetailRow, version time.Time) error

Export flattens and exports the grouped changepoints to BigQuery.

type FakeClient

type FakeClient struct {
	Insertions []*bqp.GroupedChangepointRow
}

FakeClient represents a fake implementation of the test variant branch exporter, for testing.

func NewFakeClient

func NewFakeClient() *FakeClient

NewFakeClient creates a new FakeClient for exporting test variant branches.

func (*FakeClient) Insert

func (fc *FakeClient) Insert(ctx context.Context, rows []*bqp.GroupedChangepointRow) error

Insert inserts the given rows in BigQuery.

type InsertClient

type InsertClient interface {
	// Insert inserts the given rows into BigQuery.
	Insert(ctx context.Context, rows []*bqpb.GroupedChangepointRow) error
}

InsertClient defines an interface for inserting rows into BigQuery.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL