Documentation ¶
Overview ¶
Package bq provides a set of helpers to interact with bq tool (part of CloudSDK)
Index ¶
- func Run(t testing.TB, cmd string, opts ...cmdOption) gjson.Result
- func RunCmd(t testing.TB, cmd string, opts ...cmdOption) string
- func RunCmdE(t testing.TB, cmd string, opts ...cmdOption) (string, error)
- func RunWithCmdOptsf(t testing.TB, opts []cmdOption, cmd string, args ...interface{}) gjson.Result
- func Runf(t testing.TB, cmd string, args ...interface{}) gjson.Result
- func WithBinary(bqBinary string) cmdOption
- func WithCommonArgs(commonArgs []string) cmdOption
- func WithLogger(logger *logger.Logger) cmdOption
- type CmdCfg
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Run ¶
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 RunWithCmdOptsf ¶
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 ¶
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