diff --git a/mocks/bigquery_client_mock.go b/mocks/bigquery_client_mock.go new file mode 100644 index 00000000..e69de29b diff --git a/services/ bigquery_client.go b/services/ bigquery_client.go new file mode 100644 index 00000000..28ef77b9 --- /dev/null +++ b/services/ bigquery_client.go @@ -0,0 +1,23 @@ + +package bigqueryclient + +import ( + "context" + "cloud.google.com/go/bigquery" +) + +// BigQueryClient defines the interface for the BigQuery client +type BigQueryClient interface { + CreateTable(ctx context.Context, datasetID string, tableID string, schema bigquery.Schema) error +} + +// MyBigQueryClient implements the BigQueryClient interface +type MyBigQueryClient struct { + client *bigquery.Client +} + +// CreateTable creates a new table in BigQuery +func (m *MyBigQueryClient) CreateTable(ctx context.Context, datasetID string, tableID string, schema bigquery.Schema) error { + table := m.client.Dataset(datasetID).Table(tableID) + return table.Create(ctx, &bigquery.TableMetadata{Schema: schema}) +} diff --git a/services/myservice.go b/services/myservice.go new file mode 100644 index 00000000..e69de29b diff --git a/services/myservice_test.go b/services/myservice_test.go new file mode 100644 index 00000000..e69de29b