Versions in this module Expand all Collapse all v0 v0.7.1 Jul 25, 2023 v0.7.0 Jul 20, 2023 Changes in this version + const ConcurrentLimit + const ConcurrentTicketPerSec + const DatesetNameSections + const EntityDataset + const EntityExternalTable + const EntityResourceSchema + const EntityTable + const EntityView + const KindDataset + const KindExternalTable + const KindTable + const KindView + const ModeNullable + const ModeRepeated + const ModeRequired + const TableNameSections + func BackupResources(ctx context.Context, backup *resource.Backup, resources []*resource.Resource, ...) (*resource.BackupResult, error) + func BackupTable(ctx context.Context, backup *resource.Backup, source *resource.Resource, ...) (string, error) + func BatchesFrom(resources []*resource.Resource, provider ClientProvider) (map[string]*Batch, error) + func ConfigAs(mapping map[string]any, key string) T + func ConvertSpecTo(res *resource.Resource) (*T, error) + func CopyTable(ctx context.Context, source, destination TableResourceHandle) error + func CreateIfDatasetDoesNotExist(ctx context.Context, client Client, dataset Dataset) error + func DestinationExpiry(backup *resource.Backup) (time.Time, error) + func DestinationName(sourceDatasetName, sourceName string, backup *resource.Backup) string + func ResourceNameFor(res *resource.Resource) (string, error) + func URNFor(res *resource.Resource) (string, error) + func ValidateName(res *resource.Resource) error + type BQCopier interface + Run func(context.Context) (*bigquery.Job, error) + type BQJob interface + Wait func(context.Context) (*bigquery.JobStatus, error) + type Batch struct + Dataset Dataset + DatasetDetails *resource.Resource + ExternalTables []*resource.Resource + Tables []*resource.Resource + Views []*resource.Resource + func (b *Batch) DatasetOrDefault() (*resource.Resource, error) + func (b *Batch) QueueJobs(ctx context.Context, account string, runner *parallel.Runner) error + type BqClient struct + func NewClient(ctx context.Context, svcAccount string) (*BqClient, error) + func (c *BqClient) Close() + func (c *BqClient) DatasetHandleFrom(ds Dataset) ResourceHandle + func (c *BqClient) ExternalTableHandleFrom(ds Dataset, name string) ResourceHandle + func (c *BqClient) TableHandleFrom(ds Dataset, name string) TableResourceHandle + func (c *BqClient) ViewHandleFrom(ds Dataset, name string) ResourceHandle + type BqClientProvider struct + func NewClientProvider() *BqClientProvider + func (BqClientProvider) Get(ctx context.Context, account string) (Client, error) + type BqDataset interface + Create func(context.Context, *bigquery.DatasetMetadata) error + Metadata func(context.Context) (*bigquery.DatasetMetadata, error) + Update func(context.Context, bigquery.DatasetMetadataToUpdate, string) (*bigquery.DatasetMetadata, error) + type BqTable interface + CopierFrom func(srcs ...*bigquery.Table) *bigquery.Copier + Create func(context.Context, *bigquery.TableMetadata) error + Metadata func(ctx context.Context, opts ...bigquery.TableMetadataOption) (*bigquery.TableMetadata, error) + Update func(context.Context, bigquery.TableMetadataToUpdate, string, ...) (*bigquery.TableMetadata, error) + type Client interface + Close func() + DatasetHandleFrom func(dataset Dataset) ResourceHandle + ExternalTableHandleFrom func(dataset Dataset, name string) ResourceHandle + TableHandleFrom func(dataset Dataset, name string) TableResourceHandle + ViewHandleFrom func(dataset Dataset, name string) ResourceHandle + type ClientProvider interface + Get func(ctx context.Context, account string) (Client, error) + type Cluster struct + Using []string + func (c Cluster) Validate() error + type Copier struct + func NewCopier(bqCopier BQCopier) *Copier + func (c Copier) Run(ctx context.Context) (CopyJob, error) + type CopyJob interface + Wait func(ctx context.Context) error + type Dataset struct + DatasetName string + Project string + func DataSetFor(res *resource.Resource) (Dataset, error) + func DataSetFrom(project, datasetName string) (Dataset, error) + func DestinationDataset(project string, backup *resource.Backup) (Dataset, error) + func (d Dataset) FullName() string + type DatasetDetails struct + Description string + ExtraConfig map[string]interface{} + Name resource.Name + func (DatasetDetails) Validate() error + func (d DatasetDetails) FullName() string + type DatasetHandle struct + func NewDatasetHandle(ds BqDataset) *DatasetHandle + func (d DatasetHandle) Create(ctx context.Context, res *resource.Resource) error + func (d DatasetHandle) Exists(ctx context.Context) bool + func (d DatasetHandle) Update(ctx context.Context, res *resource.Resource) error + type ExternalSource struct + Config map[string]interface{} + SourceType string + SourceURIs []string + func (e ExternalSource) Validate() error + type ExternalTable struct + Description string + ExtraConfig map[string]interface{} + Name resource.Name + Schema Schema + Source *ExternalSource + func (e *ExternalTable) FullName() string + func (e *ExternalTable) Validate() error + type ExternalTableHandle struct + func NewExternalTableHandle(bq BqTable) *ExternalTableHandle + func (et ExternalTableHandle) Create(ctx context.Context, res *resource.Resource) error + func (et ExternalTableHandle) Exists(ctx context.Context) bool + func (et ExternalTableHandle) Update(ctx context.Context, res *resource.Resource) error + type Field struct + Description string + Mode string + Name string + Schema Schema + Type string + func (f Field) Validate() error + type JobHandle struct + func NewJob(job BQJob) *JobHandle + func (j JobHandle) Wait(ctx context.Context) error + type Partition struct + Expiration int64 + Field string + Range *Range + Type string + func (p Partition) Validate() error + type Range struct + End int64 + Interval int64 + Start int64 + type ResourceHandle interface + Create func(ctx context.Context, res *resource.Resource) error + Exists func(ctx context.Context) bool + Update func(ctx context.Context, res *resource.Resource) error + type Schema []Field + func (s Schema) Validate() error + type SecretProvider interface + GetSecret func(ctx context.Context, tnnt tenant.Tenant, key string) (*tenant.PlainTextSecret, error) + type Store struct + func NewBigqueryDataStore(secretProvider SecretProvider, clientProvider ClientProvider) *Store + func (Store) GetURN(res *resource.Resource) (string, error) + func (Store) Validate(r *resource.Resource) error + func (s Store) Backup(ctx context.Context, backup *resource.Backup, resources []*resource.Resource) (*resource.BackupResult, error) + func (s Store) BatchUpdate(ctx context.Context, resources []*resource.Resource) error + func (s Store) Create(ctx context.Context, res *resource.Resource) error + func (s Store) Update(ctx context.Context, res *resource.Resource) error + type Table struct + Cluster *Cluster + Description string + ExtraConfig map[string]interface{} + Name resource.Name + Partition *Partition + Schema Schema + func (t *Table) FullName() string + func (t *Table) Validate() error + type TableCopier interface + Run func(ctx context.Context) (CopyJob, error) + type TableHandle struct + func NewTableHandle(bq BqTable) *TableHandle + func (t TableHandle) CopierFrom(source TableResourceHandle) (TableCopier, error) + func (t TableHandle) Create(ctx context.Context, res *resource.Resource) error + func (t TableHandle) Exists(ctx context.Context) bool + func (t TableHandle) GetBQTable() (*bigquery.Table, error) + func (t TableHandle) Update(ctx context.Context, res *resource.Resource) error + func (t TableHandle) UpdateExpiry(ctx context.Context, name string, expiry time.Time) error + type TableResourceHandle interface + CopierFrom func(source TableResourceHandle) (TableCopier, error) + GetBQTable func() (*bq.Table, error) + UpdateExpiry func(ctx context.Context, name string, expiry time.Time) error + type View struct + Description string + ExtraConfig map[string]interface{} + Name resource.Name + ViewQuery string + func (v *View) Validate() error + type ViewHandle struct + func NewViewHandle(bq BqTable) *ViewHandle + func (v ViewHandle) Create(ctx context.Context, res *resource.Resource) error + func (v ViewHandle) Exists(ctx context.Context) bool + func (v ViewHandle) Update(ctx context.Context, res *resource.Resource) error