mirror of
https://github.com/restic/restic.git
synced 2025-10-29 13:08:45 +00:00
Update vendored library cloud.google.com/go
This commit is contained in:
31
vendor/cloud.google.com/go/bigquery/table.go
generated
vendored
31
vendor/cloud.google.com/go/bigquery/table.go
generated
vendored
@@ -76,6 +76,9 @@ type TableMetadata struct {
|
||||
// Information about a table stored outside of BigQuery.
|
||||
ExternalDataConfig *ExternalDataConfig
|
||||
|
||||
// Custom encryption configuration (e.g., Cloud KMS keys).
|
||||
EncryptionConfig *EncryptionConfig
|
||||
|
||||
// All the fields below are read-only.
|
||||
|
||||
FullID string // An opaque ID uniquely identifying the table.
|
||||
@@ -175,6 +178,32 @@ func bqToTimePartitioning(q *bq.TimePartitioning) *TimePartitioning {
|
||||
}
|
||||
}
|
||||
|
||||
// EncryptionConfig configures customer-managed encryption on tables.
|
||||
type EncryptionConfig struct {
|
||||
// Describes the Cloud KMS encryption key that will be used to protect
|
||||
// destination BigQuery table. The BigQuery Service Account associated with your
|
||||
// project requires access to this encryption key.
|
||||
KMSKeyName string
|
||||
}
|
||||
|
||||
func (e *EncryptionConfig) toBQ() *bq.EncryptionConfiguration {
|
||||
if e == nil {
|
||||
return nil
|
||||
}
|
||||
return &bq.EncryptionConfiguration{
|
||||
KmsKeyName: e.KMSKeyName,
|
||||
}
|
||||
}
|
||||
|
||||
func bqToEncryptionConfig(q *bq.EncryptionConfiguration) *EncryptionConfig {
|
||||
if q == nil {
|
||||
return nil
|
||||
}
|
||||
return &EncryptionConfig{
|
||||
KMSKeyName: q.KmsKeyName,
|
||||
}
|
||||
}
|
||||
|
||||
// StreamingBuffer holds information about the streaming buffer.
|
||||
type StreamingBuffer struct {
|
||||
// A lower-bound estimate of the number of bytes currently in the streaming
|
||||
@@ -265,6 +294,7 @@ func (tm *TableMetadata) toBQ() (*bq.Table, error) {
|
||||
edc := tm.ExternalDataConfig.toBQ()
|
||||
t.ExternalDataConfiguration = &edc
|
||||
}
|
||||
t.EncryptionConfiguration = tm.EncryptionConfig.toBQ()
|
||||
if tm.FullID != "" {
|
||||
return nil, errors.New("cannot set FullID on create")
|
||||
}
|
||||
@@ -320,6 +350,7 @@ func bqToTableMetadata(t *bq.Table) (*TableMetadata, error) {
|
||||
CreationTime: unixMillisToTime(t.CreationTime),
|
||||
LastModifiedTime: unixMillisToTime(int64(t.LastModifiedTime)),
|
||||
ETag: t.Etag,
|
||||
EncryptionConfig: bqToEncryptionConfig(t.EncryptionConfiguration),
|
||||
}
|
||||
if t.Schema != nil {
|
||||
md.Schema = bqToSchema(t.Schema)
|
||||
|
||||
Reference in New Issue
Block a user