bq

package
v0.16.3 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package bq provides a set of helpers to interact with bq tool (part of CloudSDK)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(t testing.TB, cmd string, opts ...cmdOption) gjson.Result

Run executes a bq command and returns value as gjson.Result. It fails the test if there are any errors executing the bq command or parsing the output value.

func RunCmd

func RunCmd(t testing.TB, cmd string, opts ...cmdOption) string

RunCmd executes a bq command and fails test if there are any errors.

func RunCmdE

func RunCmdE(t testing.TB, cmd string, opts ...cmdOption) (string, error)

RunCmdE executes a bq command and return output.

func RunWithCmdOptsf

func RunWithCmdOptsf(t testing.TB, opts []cmdOption, cmd string, args ...interface{}) gjson.Result

RunWithCmdOptsf executes a bq command and returns value as gjson.Result.

RunWithCmdOptsf(t, ops.., "ls --datasets --project_id=%s", "projectId")

It fails the test if there are any errors executing the bq command or parsing the output value.

func Runf

func Runf(t testing.TB, cmd string, args ...interface{}) gjson.Result

Runf executes a bq command and returns value as gjson.Result.

Runf(t, "ls --datasets --project_id=%s", "projectId")

It fails the test if there are any errors executing the bq command or parsing the output value.

func WithBinary

func WithBinary(bqBinary string) cmdOption

func WithCommonArgs

func WithCommonArgs(commonArgs []string) cmdOption

func WithLogger

func WithLogger(logger *logger.Logger) cmdOption

Types

type CmdCfg

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

Jump to

Keyboard shortcuts

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