exporter

package
v0.0.0-...-a82170c Latest Latest
Warning

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

Go to latest
Published: May 4, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package exporter provides methods to interact with the failure_assocation_rules BigQuery table.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client provides methods to export and read failure_association_rules_history BigQuery tale

func NewClient

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

NewClient creates a new client for exporting failure association rules via the BigQuery Write API.

func (*Client) Close

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

Close releases resources held by the client.

func (*Client) Insert

Insert inserts the given rows in BigQuery.

func (*Client) NewestLastUpdated

func (c *Client) NewestLastUpdated(ctx context.Context) (bigquery.NullTimestamp, error)

NewestLastUpdated get the largest value in the lastUpdated field from the BigQuery table. The last_updated field is synced from the spanner table which is a spanner commit timestamp. This the newest last_updated field indicate newest update of the failureAssociationRules spanner table which has been synced to BigQuery.

type FakeClient

type FakeClient struct {
	Insertions []*bqpb.FailureAssociationRulesHistoryRow
	// contains filtered or unexported fields
}

FakeClient represents a fake implementation of the failure association rules BigQuery exporter, for testing.

func NewFakeClient

func NewFakeClient() *FakeClient

NewFakeClient creates a new FakeClient for exporting failure association rules.

func (*FakeClient) Errs

func (fc *FakeClient) Errs(errs []error) *FakeClient

Errs set errors return in the future calls in sequence.

func (*FakeClient) Insert

Insert inserts the given rows in BigQuery.

func (*FakeClient) LastUpdate

func (fc *FakeClient) LastUpdate(t time.Time) *FakeClient

LastUpdate set the output of NewestLastUpdated in future calls.

func (*FakeClient) NewestLastUpdated

func (fc *FakeClient) NewestLastUpdated(ctx context.Context) (bigquery.NullTimestamp, error)

NewestLastUpdated get the largest value in the lastUpdated field from the BigQuery table.

Jump to

Keyboard shortcuts

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