bigquery

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package bigquery connects to the GCP BigQuery API and computes metrics suitable for blackbox-probing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Probe

func Probe(ctx context.Context, r QueryRunner, table string) (string, error)

Probe executes queries against BQ and returns the resulting metrics. If no table is specified, Probe will execute a dummy query against BQ (such as 'SELECT 1'). Otherwise, table should specify an existing table in the format 'dataset.table'.

The service account cloudprober runs under should have sufficient permissions to read the table.

Types

type QueryRunner

type QueryRunner interface {
	Query(context.Context, string) (string, error)
}

The QueryRunner interface encapsulates the BigQuery API.

Query() runs the given query on BQ and returns the result and an error, if any.

func NewRunner

func NewRunner(ctx context.Context, projectID string) (QueryRunner, error)

NewRunner creates a new BQ QueryRunner associated with the given projectID.

Jump to

Keyboard shortcuts

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