MCPcopy Index your code
hub / github.com/cloudquery/cloudquery / TestConnection

Function TestConnection

plugins/destination/bigquery/client/client.go:113–136  ·  view source on GitHub ↗
(ctx context.Context, _ zerolog.Logger, specBytes []byte)

Source from the content-addressed store, hash-verified

111}
112
113func TestConnection(ctx context.Context, _ zerolog.Logger, specBytes []byte) error {
114 var s Spec
115 if err := json.Unmarshal(specBytes, &s); err != nil {
116 return &plugin.TestConnError{
117 Code: "INVALID_SPEC",
118 Message: fmt.Errorf("failed to unmarshal spec: %w", err),
119 }
120 }
121 s.SetDefaults()
122 if err := s.Validate(); err != nil {
123 return err
124 }
125
126 c, err := bqClient(ctx, s)
127 if err != nil {
128 return err
129 }
130
131 if err := validateCreds(ctx, c, s.DatasetID, s.ProjectID); err != nil {
132 return err
133 }
134
135 return c.Close()
136}

Callers

nothing calls this directly

Calls 6

SetDefaultsMethod · 0.95
ValidateMethod · 0.95
bqClientFunction · 0.85
validateCredsFunction · 0.85
ErrorfMethod · 0.80
CloseMethod · 0.65

Tested by

no test coverage detected