Movatterモバイル変換


[0]ホーム

URL:


bigtable

packagemodule
v1.42.0Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 4, 2026 License:Apache-2.0Imports:65Imported by:681

Details

Repository

github.com/googleapis/google-cloud-go

Links

Documentation

Overview

Package bigtable is an API to Google Cloud Bigtable.

Seehttps://cloud.google.com/bigtable/docs/ for general product documentation.

Seehttps://godoc.org/cloud.google.com/go for authentication, timeouts,connection pooling and similar aspects of this package.

Reading

The principal way to read from a Bigtable is to use the ReadRows method on*Table. A RowRange specifies a contiguous portion of a table. A Filter may beprovided through RowFilter to limit or transform the data that is returned.

tbl := client.Open("mytable")// Read all the rows starting with "com.google.", but only fetch the columns// in the "links" family.rr := bigtable.PrefixRange("com.google.")err := tbl.ReadRows(ctx, rr, func(r Row) bool {// TODO: do something with r.return true // Keep going.}, bigtable.RowFilter(bigtable.FamilyFilter("links")))if err != nil {// TODO: handle err.}

To read a single row, use the ReadRow helper method:

r, err := tbl.ReadRow(ctx, "com.google.cloud") // "com.google.cloud" is the entire row keyif err != nil {// TODO: handle err.}// TODO: use r.

Writing

This API exposes two distinct forms of writing to a Bigtable: a Mutation and aReadModifyWrite. The former expresses idempotent operations. The latterexpresses non-idempotent operations and returns the new values of updated cells.These operations are performed by creating a Mutation or ReadModifyWrite (withNewMutation or NewReadModifyWrite), building up one or more operations on that,and then using the Apply or ApplyReadModifyWrite methods on a Table.

For instance, to set a couple of cells in a table:

tbl := client.Open("mytable")mut := bigtable.NewMutation()// To use numeric values that will later be incremented,// they need to be big-endian encoded as 64-bit integers.buf := new(bytes.Buffer)initialLinkCount := 1 // The initial number of links.if err := binary.Write(buf, binary.BigEndian, initialLinkCount); err != nil {// TODO: handle err.}mut.Set("links", "maps.google.com", bigtable.Now(), buf.Bytes())mut.Set("links", "golang.org", bigtable.Now(), buf.Bytes())err := tbl.Apply(ctx, "com.google.cloud", mut)if err != nil {// TODO: handle err.}

To increment an encoded value in one cell:

tbl := client.Open("mytable")rmw := bigtable.NewReadModifyWrite()rmw.Increment("links", "golang.org", 12) // add 12 to the cell in column "links:golang.org"r, err := tbl.ApplyReadModifyWrite(ctx, "com.google.cloud", rmw)if err != nil {// TODO: handle err.}// TODO: use r.

Retries

If a read or write operation encounters a transient error it will be retrieduntil a successful response, an unretryable error or the context deadline isreached. Non-idempotent writes (where the timestamp is set to ServerTime) willnot be retried. In the case of ReadRows, retried calls will not re-scan rowsthat have already been processed.

Index

Examples

Constants

View Source
const (// NotKnown represents the state of an instance that could not be determined.NotKnownInstanceState =InstanceState(btapb.Instance_STATE_NOT_KNOWN)// Ready represents the state of an instance that has been successfully created.Ready =InstanceState(btapb.Instance_READY)// Creating represents the state of an instance that is currently being created.Creating =InstanceState(btapb.Instance_CREATING))
View Source
const (// UNSPECIFIED instance types default to PRODUCTIONUNSPECIFIEDInstanceType =InstanceType(btapb.Instance_TYPE_UNSPECIFIED)PRODUCTION               =InstanceType(btapb.Instance_PRODUCTION)DEVELOPMENT              =InstanceType(btapb.Instance_DEVELOPMENT))
View Source
const (// Deprecated: Use MultiClusterRoutingUseAnyConfig instead.// MultiClusterRouting is a policy that allows read/write requests to be// routed to any cluster in the instance. Requests will will fail over to// another cluster in the event of transient errors or delays. Choosing// this option sacrifices read-your-writes consistency to improve// availability.MultiClusterRouting = "multi_cluster_routing_use_any"// Deprecated: Use SingleClusterRoutingConfig instead.// SingleClusterRouting is a policy that unconditionally routes all// read/write requests to a specific cluster. This option preserves// read-your-writes consistency, but does not improve availability.SingleClusterRouting = "single_cluster_routing")

Routing policies.

View Source
const (// Scope is the OAuth scope for Cloud Bigtable data operations.Scope = "https://www.googleapis.com/auth/bigtable.data"// ReadonlyScope is the OAuth scope for Cloud Bigtable read-only data// operations.ReadonlyScope = "https://www.googleapis.com/auth/bigtable.readonly"// AdminScope is the OAuth scope for Cloud Bigtable table admin operations.AdminScope = "https://www.googleapis.com/auth/bigtable.admin.table"// InstanceAdminScope is the OAuth scope for Cloud Bigtable instance (and// cluster) admin operations.InstanceAdminScope = "https://www.googleapis.com/auth/bigtable.admin.cluster")

Scope constants for authentication credentials. These should be used whenusing credential creation functions such as oauth.NewServiceAccountFromFile.

View Source
const DefaultSnapshotDurationtime.Duration = 0

DefaultSnapshotDuration is the default TTL for a snapshot.

Variables

This section is empty.

Functions

funcCheckDirectAccessSupportedadded inv1.40.1

func CheckDirectAccessSupported(ctxcontext.Context, project, instance, appProfilestring, opts ...option.ClientOption) (bool,error)

CheckDirectAccessSupported verifies if Direct Access connectivity is enabled, configured,and actively being used for the given Cloud Bigtable instance.

Example
// Example Usage:ctx := context.Background()projectID := "my-project"instanceID := "my-instance"appProfileID := "default"// Set the environment variable if not already setos.Setenv("CBT_ENABLE_DIRECTPATH", "true")isDirectPath, err := CheckDirectAccessSupported(ctx, projectID, instanceID, appProfileID)if err != nil {log.Fatalf("DirectPath check failed: %v", err)}if isDirectPath {log.Printf("DirectPath connectivity is active for %s/%s", projectID, instanceID)} else {log.Printf("DirectPath connectivity is NOT active for %s/%s", projectID, instanceID)}

funcEqualadded inv1.30.0

func Equal(a, bType)bool

Equal compares Type objects.

funcGCRuleToString

func GCRuleToString(rule *bttdpb.GcRule)string

GCRuleToString converts the given GcRule proto to a user-visible string.

funcMarshalJSONadded inv1.30.0

func MarshalJSON(tType) ([]byte,error)

MarshalJSON returns the string representation of the Type protobuf.

Types

typeAdminClient

type AdminClient struct {// contains filtered or unexported fields}

AdminClient is a client type for performing admin operations within a specific instance.

funcNewAdminClient

func NewAdminClient(ctxcontext.Context, project, instancestring, opts ...option.ClientOption) (*AdminClient,error)

NewAdminClient creates a new AdminClient for a given project and instance.

func (*AdminClient)AuthorizedViewIAMadded inv1.23.0

func (ac *AdminClient) AuthorizedViewIAM(table, authorizedViewstring) *iam.Handle

AuthorizedViewIAM creates an IAM Handle specific to a given Table and AuthorizedView.

func (*AdminClient)AuthorizedViewInfoadded inv1.23.0

func (ac *AdminClient) AuthorizedViewInfo(ctxcontext.Context, tableID, authorizedViewIDstring) (*AuthorizedViewInfo,error)

AuthorizedViewInfo retrieves information about an authorized view.

func (*AdminClient)AuthorizedViewsadded inv1.23.0

func (ac *AdminClient) AuthorizedViews(ctxcontext.Context, tableIDstring) ([]string,error)

AuthorizedViews returns a list of the authorized views in the table.

func (*AdminClient)BackupIAMadded inv1.7.0

func (ac *AdminClient) BackupIAM(cluster, backupstring) *iam.Handle

BackupIAM creates an IAM Handle specific to a given Cluster and Backup.

func (*AdminClient)BackupInfoadded inv1.5.0

func (ac *AdminClient) BackupInfo(ctxcontext.Context, cluster, backupstring) (*BackupInfo,error)

BackupInfo gets backup metadata.

func (*AdminClient)Backupsadded inv1.5.0

func (ac *AdminClient) Backups(ctxcontext.Context, clusterstring) *BackupIterator

Backups returns a BackupIterator for iterating over the backups in a cluster.To list backups across all of the clusters in the instance specify "-" as the cluster.

func (*AdminClient)Close

func (ac *AdminClient) Close()error

Close closes the AdminClient.

func (*AdminClient)CopyBackupadded inv1.21.0

func (ac *AdminClient) CopyBackup(ctxcontext.Context, sourceCluster, sourceBackup,destProject, destInstance, destCluster, destBackupstring, expireTimetime.Time)error

CopyBackup copies the specified source backup with the user-provided expire time.

func (*AdminClient)CreateAuthorizedViewadded inv1.23.0

func (ac *AdminClient) CreateAuthorizedView(ctxcontext.Context, conf *AuthorizedViewConf)error

CreateAuthorizedView creates a new authorized view in a table.

func (*AdminClient)CreateBackupadded inv1.5.0

func (ac *AdminClient) CreateBackup(ctxcontext.Context, table, cluster, backupstring, expireTimetime.Time)error

CreateBackup creates a new backup in the specified cluster from thespecified source table with the user-provided expire time.

func (*AdminClient)CreateBackupWithOptionsadded inv1.35.0

func (ac *AdminClient) CreateBackupWithOptions(ctxcontext.Context, table, cluster, backupstring, opts ...BackupOption)error

CreateBackupWithOptions is similar to CreateBackup but lets the user specify additional options.

func (*AdminClient)CreateColumnFamily

func (ac *AdminClient) CreateColumnFamily(ctxcontext.Context, table, familystring)error

CreateColumnFamily creates a new column family in a table.

func (*AdminClient)CreateColumnFamilyWithConfigadded inv1.22.0

func (ac *AdminClient) CreateColumnFamilyWithConfig(ctxcontext.Context, table, familystring, configFamily)error

CreateColumnFamilyWithConfig creates a new column family in a table with an optional GC policy and value type.

func (*AdminClient)CreatePresplitTable

func (ac *AdminClient) CreatePresplitTable(ctxcontext.Context, tablestring, splitKeys []string)error

CreatePresplitTable creates a new table in the instance.The list of row keys will be used to initially split the table into multiple tablets.Given two split keys, "s1" and "s2", three tablets will be created,spanning the key ranges: [, s1), [s1, s2), [s2, ).This method may return before the table's creation is complete.

func (*AdminClient)CreateSchemaBundleadded inv1.39.0

func (ac *AdminClient) CreateSchemaBundle(ctxcontext.Context, conf *SchemaBundleConf)error

CreateSchemaBundle creates a new schema bundle in a table.

func (*AdminClient)CreateTable

func (ac *AdminClient) CreateTable(ctxcontext.Context, tablestring)error

CreateTable creates a new table in the instance.This method may return before the table's creation is complete.

func (*AdminClient)CreateTableFromConf

func (ac *AdminClient) CreateTableFromConf(ctxcontext.Context, conf *TableConf)error

CreateTableFromConf creates a new table in the instance from the given configuration.

func (*AdminClient)CreateTableFromSnapshot

func (ac *AdminClient) CreateTableFromSnapshot(ctxcontext.Context, table, cluster, snapshotstring)error

CreateTableFromSnapshot creates a table from snapshot.The table will be created in the same cluster as the snapshot.

This is a private alpha release of Cloud Bigtable snapshots. This featureis not currently available to most Cloud Bigtable customers. This featuremight be changed in backward-incompatible ways and is not recommended forproduction use. It is not subject to any SLA or deprecation policy.

func (*AdminClient)DeleteAuthorizedViewadded inv1.23.0

func (ac *AdminClient) DeleteAuthorizedView(ctxcontext.Context, tableID, authorizedViewIDstring)error

DeleteAuthorizedView deletes an authorized view in a table.

func (*AdminClient)DeleteBackupadded inv1.5.0

func (ac *AdminClient) DeleteBackup(ctxcontext.Context, cluster, backupstring)error

DeleteBackup deletes a backup in a cluster.

func (*AdminClient)DeleteColumnFamily

func (ac *AdminClient) DeleteColumnFamily(ctxcontext.Context, table, familystring)error

DeleteColumnFamily deletes a column family in a table and all of its data.

func (*AdminClient)DeleteSchemaBundleadded inv1.39.0

func (ac *AdminClient) DeleteSchemaBundle(ctxcontext.Context, tableID, schemaBundleIDstring)error

DeleteSchemaBundle deletes a schema bundle in a table.

func (*AdminClient)DeleteSnapshot

func (ac *AdminClient) DeleteSnapshot(ctxcontext.Context, cluster, snapshotstring)error

DeleteSnapshot deletes a snapshot in a cluster.

This is a private alpha release of Cloud Bigtable snapshots. This featureis not currently available to most Cloud Bigtable customers. This featuremight be changed in backward-incompatible ways and is not recommended forproduction use. It is not subject to any SLA or deprecation policy.

func (*AdminClient)DeleteTable

func (ac *AdminClient) DeleteTable(ctxcontext.Context, tablestring)error

DeleteTable deletes a table and all of its data.

func (*AdminClient)DropAllRowsadded inv1.1.0

func (ac *AdminClient) DropAllRows(ctxcontext.Context, tablestring)error

DropAllRows permanently deletes all rows from the specified table.

func (*AdminClient)DropRowRange

func (ac *AdminClient) DropRowRange(ctxcontext.Context, table, rowKeyPrefixstring)error

DropRowRange permanently deletes a row range from the specified table.

func (*AdminClient)EncryptionInfoadded inv1.9.0

func (ac *AdminClient) EncryptionInfo(ctxcontext.Context, tablestring) (EncryptionInfoByCluster,error)

EncryptionInfo gets the current encryption info for the table across all of the clusters.The returned map will be keyed by cluster id and contain a status for all of the keys in use.

func (*AdminClient)GetSchemaBundleadded inv1.39.0

func (ac *AdminClient) GetSchemaBundle(ctxcontext.Context, tableID, schemaBundleIDstring) (*SchemaBundleInfo,error)

GetSchemaBundle retrieves information about a schema bundle.

func (*AdminClient)RestoreTableadded inv1.5.0

func (ac *AdminClient) RestoreTable(ctxcontext.Context, table, cluster, backupstring)error

RestoreTable creates a table from a backup. The table will be created in the same cluster as the backup.To restore a table to a different instance, see RestoreTableFrom.

func (*AdminClient)RestoreTableFromadded inv1.10.0

func (ac *AdminClient) RestoreTableFrom(ctxcontext.Context, sourceInstance, table, sourceCluster, backupstring)error

RestoreTableFrom creates a new table in the admin's instance by restoring from the given backup and instance.To restore within the same instance, see RestoreTable.sourceInstance (ex. "my-instance") and sourceCluster (ex. "my-cluster") are the instance and cluster in which the new table will be restored from.tableName (ex. "my-restored-table") will be the name of the newly created table.backupName (ex. "my-backup") is the name of the backup to restore.

func (*AdminClient)SchemaBundlesadded inv1.39.0

func (ac *AdminClient) SchemaBundles(ctxcontext.Context, tableIDstring) ([]string,error)

SchemaBundles returns a list of the schema bundles in the table.

func (*AdminClient)SetGCPolicy

func (ac *AdminClient) SetGCPolicy(ctxcontext.Context, table, familystring, policyGCPolicy)error

SetGCPolicy specifies which cells in a column family should be garbage collected.GC executes opportunistically in the background; table reads may return datamatching the GC policy.

func (*AdminClient)SetGCPolicyWithOptionsadded inv1.24.0

func (ac *AdminClient) SetGCPolicyWithOptions(ctxcontext.Context, table, familystring, policyGCPolicy, opts ...GCPolicyOption)error

SetGCPolicyWithOptions is similar to SetGCPolicy but allows passing options

func (*AdminClient)SnapshotInfo

func (ac *AdminClient) SnapshotInfo(ctxcontext.Context, cluster, snapshotstring) (*SnapshotInfo,error)

SnapshotInfo gets snapshot metadata.

This is a private alpha release of Cloud Bigtable snapshots. This featureis not currently available to most Cloud Bigtable customers. This featuremight be changed in backward-incompatible ways and is not recommended forproduction use. It is not subject to any SLA or deprecation policy.

func (*AdminClient)SnapshotTable

func (ac *AdminClient) SnapshotTable(ctxcontext.Context, table, cluster, snapshotstring, ttltime.Duration)error

SnapshotTable creates a new snapshot in the specified cluster from thespecified source table. Setting the TTL to `DefaultSnapshotDuration` willuse the server side default for the duration.

This is a private alpha release of Cloud Bigtable snapshots. This featureis not currently available to most Cloud Bigtable customers. This featuremight be changed in backward-incompatible ways and is not recommended forproduction use. It is not subject to any SLA or deprecation policy.

func (*AdminClient)Snapshots

func (ac *AdminClient) Snapshots(ctxcontext.Context, clusterstring) *SnapshotIterator

Snapshots returns a SnapshotIterator for iterating over the snapshots in a cluster.To list snapshots across all of the clusters in the instance specify "-" as the cluster.

This is a private alpha release of Cloud Bigtable snapshots. This feature is notcurrently available to most Cloud Bigtable customers. This feature might bechanged in backward-incompatible ways and is not recommended for production use.It is not subject to any SLA or deprecation policy.

func (*AdminClient)TableIAMadded inv1.1.0

func (ac *AdminClient) TableIAM(tableIDstring) *iam.Handle

TableIAM creates an IAM Handle specific to a given Instance and Table within the configured project.

func (*AdminClient)TableInfo

func (ac *AdminClient) TableInfo(ctxcontext.Context, tablestring) (*TableInfo,error)

TableInfo retrieves information about a table.

func (*AdminClient)Tables

func (ac *AdminClient) Tables(ctxcontext.Context) ([]string,error)

Tables returns a list of the tables in the instance.

func (*AdminClient)UpdateAuthorizedViewadded inv1.23.0

func (ac *AdminClient) UpdateAuthorizedView(ctxcontext.Context, confUpdateAuthorizedViewConf)error

UpdateAuthorizedView updates an authorized view in a table according to the given configuration.

func (*AdminClient)UpdateBackupadded inv1.5.0

func (ac *AdminClient) UpdateBackup(ctxcontext.Context, cluster, backupstring, expireTimetime.Time)error

UpdateBackup updates the backup metadata in a cluster. The API only supports updating expire time.

func (*AdminClient)UpdateBackupHotToStandardTimeadded inv1.35.0

func (ac *AdminClient) UpdateBackupHotToStandardTime(ctxcontext.Context, cluster, backupstring, hotToStandardTimetime.Time)error

UpdateBackupHotToStandardTime updates the HotToStandardTime of a hot backup.

func (*AdminClient)UpdateBackupRemoveHotToStandardTimeadded inv1.35.0

func (ac *AdminClient) UpdateBackupRemoveHotToStandardTime(ctxcontext.Context, cluster, backupstring)error

UpdateBackupRemoveHotToStandardTime removes the HotToStandardTime of a hot backup.

func (*AdminClient)UpdateFamilyadded inv1.30.0

func (ac *AdminClient) UpdateFamily(ctxcontext.Context, table, familyNamestring, familyFamily, opts ...UpdateFamilyOption)error

UpdateFamily updates column families' garbage collection policies and value type.

func (*AdminClient)UpdateSchemaBundleadded inv1.39.0

func (ac *AdminClient) UpdateSchemaBundle(ctxcontext.Context, confUpdateSchemaBundleConf)error

UpdateSchemaBundle updates a schema bundle in a table according to the given configuration.

func (*AdminClient)UpdateTableDisableAutomatedBackupPolicyadded inv1.24.0

func (ac *AdminClient) UpdateTableDisableAutomatedBackupPolicy(ctxcontext.Context, tableIDstring)error

UpdateTableDisableAutomatedBackupPolicy updates a table to disable automated backups for table ID.

func (*AdminClient)UpdateTableDisableChangeStreamadded inv1.19.0

func (ac *AdminClient) UpdateTableDisableChangeStream(ctxcontext.Context, tableIDstring)error

UpdateTableDisableChangeStream updates a table to disable change stream for table ID.

func (*AdminClient)UpdateTableRemoveRowKeySchemaadded inv1.36.0

func (ac *AdminClient) UpdateTableRemoveRowKeySchema(ctxcontext.Context, tableIDstring)error

UpdateTableRemoveRowKeySchema removes a RowKeySchema from a table.

func (*AdminClient)UpdateTableWithAutomatedBackupPolicyadded inv1.24.0

func (ac *AdminClient) UpdateTableWithAutomatedBackupPolicy(ctxcontext.Context, tableIDstring, automatedBackupPolicyTableAutomatedBackupPolicy)error

UpdateTableWithAutomatedBackupPolicy updates a table to with the given table ID and automated backup policy config.

func (*AdminClient)UpdateTableWithChangeStreamadded inv1.19.0

func (ac *AdminClient) UpdateTableWithChangeStream(ctxcontext.Context, tableIDstring, changeStreamRetentionChangeStreamRetention)error

UpdateTableWithChangeStream updates a table to with the given table ID and change stream config.

func (*AdminClient)UpdateTableWithDeletionProtectionadded inv1.17.0

func (ac *AdminClient) UpdateTableWithDeletionProtection(ctxcontext.Context, tableIDstring, deletionProtectionDeletionProtection)error

UpdateTableWithDeletionProtection updates a table with the given table ID and deletion protection parameter.

func (*AdminClient)UpdateTableWithRowKeySchemaadded inv1.36.0

func (ac *AdminClient) UpdateTableWithRowKeySchema(ctxcontext.Context, tableIDstring, rowKeySchemaStructType)error

UpdateTableWithRowKeySchema updates a table with RowKeySchema.

func (*AdminClient)WaitForReplication

func (ac *AdminClient) WaitForReplication(ctxcontext.Context, tablestring)error

WaitForReplication waits until all the writes committed before the call started have been propagated to all the clusters in the instance via replication.

typeAggregateTypeadded inv1.22.0

type AggregateType struct {InputTypeAggregatorAggregator}

AggregateType represents an aggregate. See types.proto for more detailson aggregate types.

typeAggregatoradded inv1.22.0

type Aggregator interface {// contains filtered or unexported methods}

Aggregator represents an aggregation function for an aggregate type.

typeAppProfileIsolationadded inv1.37.0

type AppProfileIsolation interface {// contains filtered or unexported methods}

AppProfileIsolation represents the configuration for a specific traffic isolation policy.

typeAppProfilePriorityadded inv1.37.0

type AppProfilePriorityint32

AppProfilePriority represents possible priorities for an app profile.

const (// AppProfilePriorityUnspecified is the default value. Mapped to PRIORITY_HIGH (the legacy behavior) on creation.AppProfilePriorityUnspecifiedAppProfilePriority =AppProfilePriority(btapb.AppProfile_PRIORITY_UNSPECIFIED)// AppProfilePriorityLow represents the lowest priority.AppProfilePriorityLowAppProfilePriority =AppProfilePriority(btapb.AppProfile_PRIORITY_LOW)// AppProfilePriorityMedium represents the medium priority.AppProfilePriorityMediumAppProfilePriority =AppProfilePriority(btapb.AppProfile_PRIORITY_MEDIUM)// AppProfilePriorityHigh represents the highest priority.AppProfilePriorityHighAppProfilePriority =AppProfilePriority(btapb.AppProfile_PRIORITY_HIGH))

typeApplyOption

type ApplyOption interface {// contains filtered or unexported methods}

An ApplyOption is an optional argument to Apply.

funcGetCondMutationResult

func GetCondMutationResult(matched *bool)ApplyOption

GetCondMutationResult returns an ApplyOption that reports whether the conditionalmutation's condition matched.

typeArraySQLTypeadded inv1.36.0

type ArraySQLType struct {ElemTypeSQLType}

ArraySQLType represents an ordered list of elements of a given type.

typeAuthorizedViewConfadded inv1.23.0

type AuthorizedViewConf struct {TableIDstringAuthorizedViewIDstring// Types that are valid to be assigned to AuthorizedView://  *SubsetViewConfAuthorizedView     isAuthorizedViewDeletionProtectionDeletionProtection}

AuthorizedViewConf contains information about an authorized view.

typeAuthorizedViewInfoadded inv1.23.0

type AuthorizedViewInfo struct {TableIDstringAuthorizedViewIDstringAuthorizedView     isAuthorizedViewInfoDeletionProtectionDeletionProtection}

AuthorizedViewInfo contains authorized view metadata. This struct is read-only.

typeAutoscalingConfigadded inv1.13.0

type AutoscalingConfig struct {// MinNodes sets the minimum number of nodes in a cluster. MinNodes must// be 1 or greater.MinNodesint// MaxNodes sets the maximum number of nodes in a cluster. MaxNodes must be// equal to or greater than MinNodes.MaxNodesint// CPUTargetPercent sets the CPU utilization target for your cluster's// workload.CPUTargetPercentint// StorageUtilizationPerNode sets the storage usage target, in GB, for// each node in a cluster. This number is limited between 2560 (2.5TiB) and// 5120 (5TiB) for a SSD cluster and between 8192 (8TiB) and 16384 (16 TiB)// for an HDD cluster. If set to zero, the default values are used:// 2560 for SSD and 8192 for HDD.StorageUtilizationPerNodeint}

AutoscalingConfig contains autoscaling configuration for a cluster.For details, seehttps://cloud.google.com/bigtable/docs/autoscaling.

typeBackupInfoadded inv1.5.0

type BackupInfo struct {NamestringSourceTablestringSourceBackupstringSizeBytesint64StartTimetime.TimeEndTimetime.TimeExpireTimetime.TimeStatestringEncryptionInfo *EncryptionInfoBackupTypeBackupType// The time at which the hot backup will be converted to a standard backup.// Once the `hot_to_standard_time` has passed, Cloud Bigtable will convert the// hot backup to a standard backup. This value must be greater than the backup// creation time by at least 24 hours//// This field only applies for hot backups.HotToStandardTime *time.Time}

BackupInfo contains backup metadata. This struct is read-only.

typeBackupIteratoradded inv1.5.0

type BackupIterator struct {// contains filtered or unexported fields}

BackupIterator is an EntryIterator that iterates over log entries.

func (*BackupIterator)Nextadded inv1.5.0

func (it *BackupIterator) Next() (*BackupInfo,error)

Next returns the next result. Its second return value is iterator.Done(https://godoc.org/google.golang.org/api/iterator) if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.

func (*BackupIterator)PageInfoadded inv1.5.0

func (it *BackupIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. Seehttps://godoc.org/google.golang.org/api/iterator package for details.

typeBackupOptionadded inv1.35.0

type BackupOption func(*backupOptions)

BackupOption can be used to specify parameters for backup operations.

funcWithExpiryadded inv1.35.0

func WithExpiry(expireTimetime.Time)BackupOption

WithExpiry option can be used to create backupthat expires after time 'expireTime'.Once the 'expireTime' has passed, Cloud Bigtable will delete the backup.

funcWithHotBackupadded inv1.35.0

func WithHotBackup()BackupOption

WithHotBackup option can be used to create backupwith typeBackupTypeHot

funcWithHotToStandardBackupadded inv1.35.0

func WithHotToStandardBackup(hotToStandardTimetime.Time)BackupOption

WithHotToStandardBackup option can be used to create backup withtypeBackupTypeHot and specify time at which the hot backup will beconverted to a standard backup. Once the 'hotToStandardTime' has passed,Cloud Bigtable will convert the hot backup to a standard backup.This value must be greater than the backup creation time by at least 24 hours

typeBackupTypeadded inv1.35.0

type BackupTypeint32

BackupType denotes the type of the backup.

const (// BackupTypeUnspecified denotes that backup type has not been specified.BackupTypeUnspecifiedBackupType = 0// BackupTypeStandard is the default type for Cloud Bigtable managed backups. Supported for// backups created in both HDD and SSD instances. Requires optimization when// restored to a table in an SSD instance.BackupTypeStandardBackupType = 1// BackupTypeHot is a backup type with faster restore to SSD performance. Only supported for// backups created in SSD instances. A new SSD table restored from a hot// backup reaches production performance more quickly than a standard// backup.BackupTypeHotBackupType = 2)

typeBigEndianBytesEncodingadded inv1.22.0

type BigEndianBytesEncoding struct {}

BigEndianBytesEncoding represents an Int64 encoding where the value is encodedas an 8-byte big-endian value.

typeBoolSQLTypeadded inv1.36.0

type BoolSQLType struct{}

BoolSQLType represents a boolean.

typeBoundStatementadded inv1.36.0

type BoundStatement struct {// contains filtered or unexported fields}

BoundStatement is a statement that has been bound to a set of parameters.It is created by callingPreparedStatement.Bind.

func (*BoundStatement)Executeadded inv1.36.0

func (bs *BoundStatement) Execute(ctxcontext.Context, f func(ResultRow)bool, opts ...ExecuteOption) (errerror)

Execute executes a previously prepared query. f is called for each row in result set.If f returns false, the stream is shut down and Execute returns.f owns its argument, and f is called serially in order of results returned.f will be executed in the same Go routine as the caller.

typeBytesEncodingadded inv1.22.0

type BytesEncoding interface {// contains filtered or unexported methods}

BytesEncoding represents the encoding of a Bytes type.

typeBytesSQLTypeadded inv1.36.0

type BytesSQLType struct{}

BytesSQLType represents a slice of bytes.

typeBytesTypeadded inv1.22.0

type BytesType struct {EncodingBytesEncoding}

BytesType represents a string of bytes.

typeChangeStreamRetentionadded inv1.19.0

type ChangeStreamRetentionoptional.Duration

ChangeStreamRetention indicates how long bigtable should retain change data.Minimum is 1 day. Maximum is 7. nil to not change the retention period. 0 todisable change stream retention.

typeClient

type Client struct {// contains filtered or unexported fields}

Client is a client for reading and writing data to tables in an instance.

A Client is safe to use concurrently, except for its Close method.

funcNewClient

func NewClient(ctxcontext.Context, project, instancestring, opts ...option.ClientOption) (*Client,error)

NewClient creates a new Client for a given project and instance.The default ClientConfig will be used.

funcNewClientWithConfig

func NewClientWithConfig(ctxcontext.Context, project, instancestring, configClientConfig, opts ...option.ClientOption) (*Client,error)

NewClientWithConfig creates a new client with the given config.

func (*Client)Close

func (c *Client) Close()error

Close closes the Client.

func (*Client)Open

func (c *Client) Open(tablestring) *Table

Open opens a table.

func (*Client)OpenAuthorizedViewadded inv1.23.0

func (c *Client) OpenAuthorizedView(table, authorizedViewstring)TableAPI

OpenAuthorizedView opens an authorized view.

func (*Client)OpenMaterializedViewadded inv1.36.0

func (c *Client) OpenMaterializedView(materializedViewstring)TableAPI

OpenMaterializedView opens a materialized view.

func (*Client)OpenTableadded inv1.23.0

func (c *Client) OpenTable(tablestring)TableAPI

OpenTable opens a table.

func (*Client)PingAndWarmadded inv1.39.0

func (c *Client) PingAndWarm(ctxcontext.Context) (errerror)

PingAndWarm pings the server and warms up the connection.

func (*Client)PrepareStatementadded inv1.36.0

func (c *Client) PrepareStatement(ctxcontext.Context, querystring, paramTypes map[string]SQLType, opts ...PrepareOption) (preparedStatement *PreparedStatement, errerror)

PrepareStatement prepares a query for execution. If possible, this should be called once andreused across requests. This will amortize the cost of query preparation.

The query string can be a parameterized query containing placeholders in the form of @ followed by the parameter nameParameter names may consist of any combination of letters, numbers, and underscores.

Parameters can appear anywhere that a literal value is expected. The same parameter name canbe used more than once, for example: WHERE cf["qualifier1"] = @value OR cf["qualifier2"] = @value

typeClientConfig

type ClientConfig struct {// The id of the app profile to associate with all data operations sent from this client.// If unspecified, the default app profile for the instance will be used.AppProfilestring// If not set or set to nil, client side metrics will be collected and exported//// To disable client side metrics, set 'MetricsProvider' to 'NoopMetricsProvider'//// TODO: support user provided meter providerMetricsProviderMetricsProvider// If true, enable dynamic channel poolEnableDynamicChannelPoolbool}

ClientConfig has configurations for the client.

typeClusterConfig

type ClusterConfig struct {// InstanceID specifies the unique name of the instance. Required.InstanceIDstring// ClusterID specifies the unique name of the cluster. Required.ClusterIDstring// Zone specifies the location where this cluster's nodes and storage reside.// For best performance, clients should be located as close as possible to this// cluster. Required.Zonestring// NumNodes specifies the number of nodes allocated to this cluster. More// nodes enable higher throughput and more consistent performance. One of// NumNodes or AutoscalingConfig is required. If both are set,// AutoscalingConfig takes precedence.NumNodesint32// StorageType specifies the type of storage used by this cluster to serve// its parent instance's tables, unless explicitly overridden. Required.StorageTypeStorageType// KMSKeyName is the name of the KMS customer managed encryption key (CMEK)// to use for at-rest encryption of data in this cluster.  If omitted,// Google's default encryption will be used. If specified, the requirements// for this key are:// 1) The Cloud Bigtable service account associated with the//    project that contains the cluster must be granted the//    “cloudkms.cryptoKeyEncrypterDecrypter“ role on the//    CMEK.// 2) Only regional keys can be used and the region of the//    CMEK key must match the region of the cluster.// 3) All clusters within an instance must use the same CMEK//    key.// Optional. Immutable.KMSKeyNamestring// AutoscalingConfig configures the autoscaling properties on a cluster.// One of NumNodes or AutoscalingConfig is required.AutoscalingConfig *AutoscalingConfig// NodeScalingFactor controls the scaling factor of the cluster (i.e. the// increment in which NumNodes can be set). Node scaling delivers better// latency and more throughput by removing node boundaries. It is optional,// with the default being 1X.NodeScalingFactorNodeScalingFactor}

ClusterConfig contains the information necessary to create a cluster

typeClusterInfo

type ClusterInfo struct {// Name is the name of the cluster.Namestring// Zone is the GCP zone of the cluster (e.g. "us-central1-a").Zonestring// ServeNodes is the number of allocated serve nodes.ServeNodesint// State is the state of the cluster.Statestring// StorageType is the storage type of the cluster.StorageTypeStorageType// KMSKeyName is the customer managed encryption key for the cluster.KMSKeyNamestring// AutoscalingConfig are the configured values for a cluster.AutoscalingConfig *AutoscalingConfig// NodeScalingFactor controls the scaling factor of the cluster.NodeScalingFactorNodeScalingFactor}

ClusterInfo represents information about a cluster.

typeColumnMetadataadded inv1.36.0

type ColumnMetadata struct {// Name is the name of the column as returned by the query (e.g., alias or derived name).Namestring// SQLType provides the original Bigtable SQL type information. This can be useful// for understanding the underlying storage or type details.SQLTypeSQLType}

ColumnMetadata describes a single column in a ResultRowMetadata.

typeDataBoostIsolationReadOnlyadded inv1.37.0

type DataBoostIsolationReadOnly struct {// Compute Billing Owner specifies how usage should be accounted when using// Data Boost. Compute Billing Owner also configures which Cloud Project is// charged for relevant quota.ComputeBillingOwnerIsolationComputeBillingOwner}

DataBoostIsolationReadOnly configures Data Boost isolation.Data Boost is a serverless compute capability that lets you runhigh-throughput read jobs and queries on your Bigtable data, withoutimpacting the performance of the clusters that handle your applicationtraffic. Data Boost supports read-only use cases with single-clusterrouting.

typeDateSQLTypeadded inv1.36.0

type DateSQLType struct{}

DateSQLType represents a calendar date.

typeDeletionProtectionadded inv1.17.0

type DeletionProtectionint

DeletionProtection indicates whether the table, authorized view, logical view ormaterialized view is protected against data loss i.e. when set to protected,deleting the view, the table, the column families in the table,and the instance containing the table or view would be prohibited.

const (NoneDeletionProtection =iotaProtectedUnprotected)

None indicates that deletion protection is unsetProtected indicates that deletion protection is enabledUnprotected indicates that deletion protection is disabled

typeEncryptionInfoadded inv1.9.0

type EncryptionInfo struct {Status        *StatusTypeEncryptionTypeKMSKeyVersionstring}

EncryptionInfo represents the encryption info of a table.

typeEncryptionInfoByClusteradded inv1.9.0

type EncryptionInfoByCluster map[string][]*EncryptionInfo

EncryptionInfoByCluster is a map of cluster name to EncryptionInfo

typeEncryptionTypeadded inv1.9.0

type EncryptionTypeint32

EncryptionType is the type of encryption for an instance.

const (// EncryptionTypeUnspecified is the type was not specified, though data at rest remains encrypted.EncryptionTypeUnspecifiedEncryptionType =iota// GoogleDefaultEncryption represents that data backing this resource is// encrypted at rest with a key that is fully managed by Google. No key// version or status will be populated. This is the default state.GoogleDefaultEncryption// CustomerManagedEncryption represents that data backing this resource is// encrypted at rest with a key that is managed by the customer.// The in-use version of the key and its status are populated for// CMEK-protected tables.// CMEK-protected backups are pinned to the key version that was in use at// the time the backup was taken. This key version is populated but its// status is not tracked and is reported as `UNKNOWN`.CustomerManagedEncryption)

typeErrPartiallyUnavailableadded inv1.6.0

type ErrPartiallyUnavailable struct {Locations []string// unavailable locations}

ErrPartiallyUnavailable is returned when some locations (clusters) areunavailable. Both partial results (retrieved from available locations)and the error are returned when this exception occurred.

func (ErrPartiallyUnavailable)Erroradded inv1.6.0

typeExecuteOptionadded inv1.36.0

type ExecuteOption interface{}

ExecuteOption is an optional argument to Execute.

typeFamilyadded inv1.22.0

type Family struct {GCPolicyGCPolicyValueTypeType}

Family represents a column family with its optional GC policy and value type.

typeFamilyInfo

type FamilyInfo struct {NamestringGCPolicystringFullGCPolicyGCPolicyValueTypeType}

FamilyInfo represents information about a column family.

typeFamilySubsetadded inv1.23.0

type FamilySubset struct {Qualifiers        [][]byteQualifierPrefixes [][]byte}

FamilySubset represents a subset of a column family.

typeFilter

type Filter interface {String()string// contains filtered or unexported methods}

A Filter represents a row filter.

funcBlockAllFilter

func BlockAllFilter()Filter

BlockAllFilter returns a filter that matches nothing.

funcCellsPerRowLimitFilter

func CellsPerRowLimitFilter(nint)Filter

CellsPerRowLimitFilter returns a filter that matches only the first N cells of each row.

funcCellsPerRowOffsetFilter

func CellsPerRowOffsetFilter(nint)Filter

CellsPerRowOffsetFilter returns a filter that skips the first N cells of each row, matching all subsequent cells.

funcChainFilters

func ChainFilters(sub ...Filter)Filter

ChainFilters returns a filter that applies a sequence of filters.

funcColumnFilter

func ColumnFilter(patternstring)Filter

ColumnFilter returns a filter that matches cells whose column namematches the provided RE2 pattern.Seehttps://github.com/google/re2/wiki/Syntax for the accepted syntax.

funcColumnRangeFilter

func ColumnRangeFilter(family, start, endstring)Filter

ColumnRangeFilter returns a filter that matches a contiguous range of columns within a singlefamily, as specified by an inclusive start qualifier and exclusive end qualifier.

funcConditionFilter

func ConditionFilter(predicateFilter, trueFilter, falseFilterFilter)Filter

ConditionFilter returns a filter that evaluates to one of two possible filters dependingon whether or not the given predicate filter matches at least one cell.If the matched filter is nil then no results will be returned.IMPORTANT NOTE: The predicate filter does not execute atomically with thetrue and false filters, which may lead to inconsistent or unexpectedresults. Additionally, condition filters have poor performance, especiallywhen filters are set for the false condition.

funcFamilyFilter

func FamilyFilter(patternstring)Filter

FamilyFilter returns a filter that matches cells whose family namematches the provided RE2 pattern.Seehttps://github.com/google/re2/wiki/Syntax for the accepted syntax.

funcInterleaveFilters

func InterleaveFilters(sub ...Filter)Filter

InterleaveFilters returns a filter that applies a set of filters in paralleland interleaves the results.

funcLabelFilteradded inv1.6.0

func LabelFilter(labelstring)Filter

LabelFilter returns a filter that applies thegiven label to all cells in the output row.

funcLatestNFilter

func LatestNFilter(nint)Filter

LatestNFilter returns a filter that matches the most recent N cells in each column.

funcPassAllFilter

func PassAllFilter()Filter

PassAllFilter returns a filter that matches everything.

funcRowKeyFilter

func RowKeyFilter(patternstring)Filter

RowKeyFilter returns a filter that matches cells from rows whosekey matches the provided RE2 pattern.Seehttps://github.com/google/re2/wiki/Syntax for the accepted syntax.

funcRowSampleFilter

func RowSampleFilter(pfloat64)Filter

RowSampleFilter returns a filter that matches a row with a probability of p (must be in the interval (0, 1)).

funcStripValueFilter

func StripValueFilter()Filter

StripValueFilter returns a filter that replaces each value with the empty string.

funcTimestampRangeFilter

func TimestampRangeFilter(startTimetime.Time, endTimetime.Time)Filter

TimestampRangeFilter returns a filter that matches any cells whose timestamp is within the given time bounds. A zerotime means no bound.The timestamp will be truncated to millisecond granularity.

funcTimestampRangeFilterMicros

func TimestampRangeFilterMicros(startTimeTimestamp, endTimeTimestamp)Filter

TimestampRangeFilterMicros returns a filter that matches any cells whose timestamp is within the given time bounds,specified in units of microseconds since 1 January 1970. A zero value for the end time is interpreted as no bound.The timestamp will be truncated to millisecond granularity.

funcValueFilter

func ValueFilter(patternstring)Filter

ValueFilter returns a filter that matches cells whose valuematches the provided RE2 pattern.Seehttps://github.com/google/re2/wiki/Syntax for the accepted syntax.

funcValueRangeFilter

func ValueRangeFilter(start, end []byte)Filter

ValueRangeFilter returns a filter that matches cells with values that fall withinthe given range, as specified by an inclusive start value and exclusive end value.

typeFloat32SQLTypeadded inv1.36.0

type Float32SQLType struct{}

Float32SQLType represents a 32-bit floating-point number.

typeFloat64SQLTypeadded inv1.36.0

type Float64SQLType struct{}

Float64SQLType represents a 64-bit floating-point number.

typeFullReadStatsadded inv1.18.0

type FullReadStats struct {// Iteration stats describe how efficient the read is, e.g. comparing rows seen vs. rows// returned or cells seen vs cells returned can provide an indication of read efficiency// (the higher the ratio of seen to retuned the better).ReadIterationStatsReadIterationStats// Request latency stats describe the time taken to complete a request, from the server// side.RequestLatencyStatsRequestLatencyStats}

FullReadStats captures all known information about a read.

typeFullReadStatsFuncadded inv1.18.0

type FullReadStatsFunc func(*FullReadStats)

FullReadStatsFunc describes a callback that receives a FullReadStats for evaluation.

typeGCPolicy

type GCPolicy interface {String()string// contains filtered or unexported methods}

A GCPolicy represents a rule that determines which cells are eligible for garbage collection.

funcIntersectionPolicy

func IntersectionPolicy(sub ...GCPolicy)GCPolicy

IntersectionPolicy returns a GC policy that only applies when all its sub-policies apply.

funcMaxAgePolicy

func MaxAgePolicy(dtime.Duration)GCPolicy

MaxAgePolicy returns a GC policy that applies to all cellsolder than the given age.

funcMaxVersionsPolicy

func MaxVersionsPolicy(nint)GCPolicy

MaxVersionsPolicy returns a GC policy that applies to all versions of a cellexcept for the most recent n.

funcNoGcPolicy

func NoGcPolicy()GCPolicy

NoGcPolicy applies to all cells setting maxage and maxversions to nil implies no gc policies

funcUnionPolicy

func UnionPolicy(sub ...GCPolicy)GCPolicy

UnionPolicy returns a GC policy that applies when any of its sub-policies apply.

typeGCPolicyOptionadded inv1.24.0

type GCPolicyOption interface {// contains filtered or unexported methods}

GCPolicyOption is deprecated, kept for backwards compatibility, use UpdateFamilyOption in new code

funcIgnoreWarningsadded inv1.24.0

func IgnoreWarnings()GCPolicyOption

IgnoreWarnings returns a updateFamilyOption that ignores safety checks when modifying the column families

typeHllppUniqueCountAggregatoradded inv1.28.0

type HllppUniqueCountAggregator struct{}

HllppUniqueCountAggregator is an aggregation function that calculates the unique count of inputs and the accumulator.

typeInstanceAdminClient

type InstanceAdminClient struct {// contains filtered or unexported fields}

InstanceAdminClient is a client type for performing admin operations on instances.These operations can be substantially more dangerous than those provided by AdminClient.

funcNewInstanceAdminClient

func NewInstanceAdminClient(ctxcontext.Context, projectstring, opts ...option.ClientOption) (*InstanceAdminClient,error)

NewInstanceAdminClient creates a new InstanceAdminClient for a given project.

func (*InstanceAdminClient)Close

func (iac *InstanceAdminClient) Close()error

Close closes the InstanceAdminClient.

func (*InstanceAdminClient)Clusters

func (iac *InstanceAdminClient) Clusters(ctxcontext.Context, instanceIDstring) ([]*ClusterInfo,error)

Clusters lists the clusters in an instance. If any location(cluster) is unavailable due to some transient conditions, Clustersreturns partial results and ErrPartiallyUnavailable error withunavailable locations list.

func (*InstanceAdminClient)CreateAppProfile

func (iac *InstanceAdminClient) CreateAppProfile(ctxcontext.Context, profileProfileConf) (*btapb.AppProfile,error)

CreateAppProfile creates an app profile within an instance.

func (*InstanceAdminClient)CreateCluster

func (iac *InstanceAdminClient) CreateCluster(ctxcontext.Context, conf *ClusterConfig)error

CreateCluster creates a new cluster in an instance.This method will return when the cluster has been created or when an error occurs.

func (*InstanceAdminClient)CreateInstance

func (iac *InstanceAdminClient) CreateInstance(ctxcontext.Context, conf *InstanceConf)error

CreateInstance creates a new instance in the project.This method will return when the instance has been created or when an error occurs.

func (*InstanceAdminClient)CreateInstanceWithClusters

func (iac *InstanceAdminClient) CreateInstanceWithClusters(ctxcontext.Context, conf *InstanceWithClustersConfig)error

CreateInstanceWithClusters creates a new instance with configured clusters in the project.This method will return when the instance has been created or when an error occurs.

func (*InstanceAdminClient)CreateLogicalViewadded inv1.36.0

func (iac *InstanceAdminClient) CreateLogicalView(ctxcontext.Context, instanceIDstring, conf *LogicalViewInfo)error

CreateLogicalView creates a new logical view in an instance.

func (*InstanceAdminClient)CreateMaterializedViewadded inv1.36.0

func (iac *InstanceAdminClient) CreateMaterializedView(ctxcontext.Context, instanceIDstring, conf *MaterializedViewInfo)error

CreateMaterializedView creates a new materialized view in an instance.

func (*InstanceAdminClient)DeleteAppProfile

func (iac *InstanceAdminClient) DeleteAppProfile(ctxcontext.Context, instanceID, namestring)error

DeleteAppProfile deletes an app profile from an instance.

func (*InstanceAdminClient)DeleteCluster

func (iac *InstanceAdminClient) DeleteCluster(ctxcontext.Context, instanceID, clusterIDstring)error

DeleteCluster deletes a cluster from an instance.

func (*InstanceAdminClient)DeleteInstance

func (iac *InstanceAdminClient) DeleteInstance(ctxcontext.Context, instanceIDstring)error

DeleteInstance deletes an instance from the project.

func (*InstanceAdminClient)DeleteLogicalViewadded inv1.36.0

func (iac *InstanceAdminClient) DeleteLogicalView(ctxcontext.Context, instanceID, logicalViewIDstring)error

DeleteLogicalView deletes a logical view in an instance.

func (*InstanceAdminClient)DeleteMaterializedViewadded inv1.36.0

func (iac *InstanceAdminClient) DeleteMaterializedView(ctxcontext.Context, instanceID, materializedViewIDstring)error

DeleteMaterializedView deletes a materialized view in an instance.

func (*InstanceAdminClient)GetAppProfile

func (iac *InstanceAdminClient) GetAppProfile(ctxcontext.Context, instanceID, namestring) (*btapb.AppProfile,error)

GetAppProfile gets information about an app profile.

func (*InstanceAdminClient)GetCluster

func (iac *InstanceAdminClient) GetCluster(ctxcontext.Context, instanceID, clusterIDstring) (*ClusterInfo,error)

GetCluster fetches a cluster in an instance

func (*InstanceAdminClient)InstanceIAM

func (iac *InstanceAdminClient) InstanceIAM(instanceIDstring) *iam.Handle

InstanceIAM returns the instance's IAM handle.

func (*InstanceAdminClient)InstanceInfo

func (iac *InstanceAdminClient) InstanceInfo(ctxcontext.Context, instanceIDstring) (*InstanceInfo,error)

InstanceInfo returns information about an instance.

func (*InstanceAdminClient)Instances

func (iac *InstanceAdminClient) Instances(ctxcontext.Context) ([]*InstanceInfo,error)

Instances returns a list of instances in the project. If any location(cluster) is unavailable due to some transient conditions, Instancesreturns partial results and ErrPartiallyUnavailable error withunavailable locations list.

func (*InstanceAdminClient)ListAppProfiles

func (iac *InstanceAdminClient) ListAppProfiles(ctxcontext.Context, instanceIDstring) *ProfileIterator

ListAppProfiles lists information about app profiles in an instance.

func (*InstanceAdminClient)LogicalViewInfoadded inv1.36.0

func (iac *InstanceAdminClient) LogicalViewInfo(ctxcontext.Context, instanceID, logicalViewIDstring) (*LogicalViewInfo,error)

LogicalViewInfo retrieves information about a logical view.

func (*InstanceAdminClient)LogicalViewsadded inv1.36.0

func (iac *InstanceAdminClient) LogicalViews(ctxcontext.Context, instanceIDstring) ([]LogicalViewInfo,error)

LogicalViews returns a list of the logical views in the instance.

func (*InstanceAdminClient)MaterializedViewInfoadded inv1.36.0

func (iac *InstanceAdminClient) MaterializedViewInfo(ctxcontext.Context, instanceID, materializedViewIDstring) (*MaterializedViewInfo,error)

MaterializedViewInfo retrieves information about a materialized view.

func (*InstanceAdminClient)MaterializedViewsadded inv1.36.0

func (iac *InstanceAdminClient) MaterializedViews(ctxcontext.Context, instanceIDstring) ([]MaterializedViewInfo,error)

MaterializedViews returns a list of the materialized views in the instance.

func (*InstanceAdminClient)SetAutoscalingadded inv1.13.0

func (iac *InstanceAdminClient) SetAutoscaling(ctxcontext.Context, instanceID, clusterIDstring, confAutoscalingConfig)error

SetAutoscaling enables autoscaling on a cluster. To remove autoscaling, useUpdateCluster. See AutoscalingConfig documentation for details.

func (*InstanceAdminClient)UpdateAppProfile

func (iac *InstanceAdminClient) UpdateAppProfile(ctxcontext.Context, instanceID, profileIDstring, updateAttrsProfileAttrsToUpdate)error

UpdateAppProfile updates an app profile within an instance.updateAttrs should be set. If unset, all fields will be replaced.

func (*InstanceAdminClient)UpdateCluster

func (iac *InstanceAdminClient) UpdateCluster(ctxcontext.Context, instanceID, clusterIDstring, serveNodesint32)error

UpdateCluster updates attributes of a cluster. If Autoscaling is configuredfor the cluster, it will be removed and replaced by the static number ofserve nodes specified.

func (*InstanceAdminClient)UpdateInstanceWithClusters

func (iac *InstanceAdminClient) UpdateInstanceWithClusters(ctxcontext.Context, conf *InstanceWithClustersConfig)error

UpdateInstanceWithClusters updates an instance and its clusters. Updateablefields are instance display name, instance type and cluster size.The provided InstanceWithClustersConfig is used as follows:

  • InstanceID is required
  • DisplayName and InstanceType are updated only if they are not empty
  • ClusterID is required for any provided cluster
  • All other cluster fields are ignored except for NumNodes andAutoscalingConfig, which if set will be updated. If both are provided,AutoscalingConfig takes precedence.

This method may return an error after partially succeeding, for example if the instance is updatedbut a cluster update fails. If an error is returned, InstanceInfo and Clusters may be called todetermine the current state.

func (*InstanceAdminClient)UpdateLogicalViewadded inv1.36.0

func (iac *InstanceAdminClient) UpdateLogicalView(ctxcontext.Context, instanceIDstring, confLogicalViewInfo)error

UpdateLogicalView updates a logical view in an instance according to the given configuration.

func (*InstanceAdminClient)UpdateMaterializedViewadded inv1.36.0

func (iac *InstanceAdminClient) UpdateMaterializedView(ctxcontext.Context, instanceIDstring, confMaterializedViewInfo)error

UpdateMaterializedView updates a materialized view in an instance according to the given configuration.

typeInstanceConf

type InstanceConf struct {InstanceId, DisplayName, ClusterId, Zonestring// NumNodes must not be specified for DEVELOPMENT instance typesNumNodesint32StorageTypeStorageTypeInstanceTypeInstanceTypeLabels       map[string]string// AutoscalingConfig configures the autoscaling properties on the cluster// created with the instance. It is optional.AutoscalingConfig *AutoscalingConfig// NodeScalingFactor controls the scaling factor of the cluster (i.e. the// increment in which NumNodes can be set). Node scaling delivers better// latency and more throughput by removing node boundaries. It is optional,// with the default being 1X.NodeScalingFactorNodeScalingFactor}

InstanceConf contains the information necessary to create an Instance

typeInstanceInfo

type InstanceInfo struct {Namestring// name of the instanceDisplayNamestring// display name for UIsInstanceStateInstanceStateInstanceTypeInstanceTypeLabels        map[string]string}

InstanceInfo represents information about an instance

typeInstanceStateadded inv1.4.0

type InstanceStateint32

InstanceState is the state of the instance. This is output-only.

typeInstanceType

type InstanceTypeint32

InstanceType is the type of the instance.

typeInstanceWithClustersConfig

type InstanceWithClustersConfig struct {InstanceID, DisplayNamestringClusters                []ClusterConfigInstanceTypeInstanceTypeLabels                  map[string]string}

InstanceWithClustersConfig contains the information necessary to create an Instance

typeInt64Encodingadded inv1.22.0

type Int64Encoding interface {// contains filtered or unexported methods}

Int64Encoding represents the encoding of an Int64 type.

typeInt64OrderedCodeBytesEncodingadded inv1.36.0

type Int64OrderedCodeBytesEncoding struct {}

Int64OrderedCodeBytesEncoding represents an Int64 encoding where the value isencoded to a variable length binary format of up to 10 bytes.

typeInt64SQLTypeadded inv1.36.0

type Int64SQLType struct{}

Int64SQLType represents an 8-byte integer.

typeInt64Typeadded inv1.22.0

type Int64Type struct {EncodingInt64Encoding}

Int64Type represents an 8-byte integer.

typeIntersectionGCPolicyadded inv1.16.0

type IntersectionGCPolicy struct {// List of children policy in the intersectionChildren []GCPolicy}

IntersectionGCPolicy with list of children

func (IntersectionGCPolicy)Stringadded inv1.16.0

func (ipIntersectionGCPolicy) String()string

typeIsolationComputeBillingOwneradded inv1.37.0

type IsolationComputeBillingOwnerint32

IsolationComputeBillingOwner specifies how usage should be accounted when usingData Boost. Compute Billing Owner also configures which Cloud Project ischarged for relevant quota.

const (// ComputeBillingOwnerUnspecified is the default value.ComputeBillingOwnerUnspecifiedIsolationComputeBillingOwner =IsolationComputeBillingOwner(btapb.AppProfile_DataBoostIsolationReadOnly_COMPUTE_BILLING_OWNER_UNSPECIFIED)// HostPays indicates that the host Cloud Project containing the targeted Bigtable Instance /// Table pays for compute.HostPaysIsolationComputeBillingOwner =IsolationComputeBillingOwner(btapb.AppProfile_DataBoostIsolationReadOnly_HOST_PAYS))

typeLogicalViewInfoadded inv1.36.0

type LogicalViewInfo struct {LogicalViewIDstringQuerystringDeletionProtectionDeletionProtection}

LogicalViewInfo contains logical view metadata. This struct is read-only.

typeMapSQLTypeadded inv1.36.0

type MapSQLType struct {KeyTypeSQLTypeValueTypeSQLType}

MapSQLType represents a map from a key type to a value type for query parameters.

typeMaterializedViewInfoadded inv1.36.0

type MaterializedViewInfo struct {MaterializedViewIDstringQuerystringDeletionProtectionDeletionProtection}

MaterializedViewInfo contains materialized view metadata. This struct is read-only.

typeMaxAgeGCPolicyadded inv1.16.0

type MaxAgeGCPolicytime.Duration

MaxAgeGCPolicy type alias

func (MaxAgeGCPolicy)GetDurationStringadded inv1.16.0

func (maMaxAgeGCPolicy) GetDurationString()string

GetDurationString returns the duration string of the MaxAgeGCPolicy

func (MaxAgeGCPolicy)Stringadded inv1.16.0

func (maMaxAgeGCPolicy) String()string

typeMaxAggregatoradded inv1.28.0

type MaxAggregator struct{}

MaxAggregator is an aggregation function that finds the maximum between the input and the accumulator.

typeMaxVersionsGCPolicyadded inv1.16.0

type MaxVersionsGCPolicyint

MaxVersionsGCPolicy type alias

func (MaxVersionsGCPolicy)Stringadded inv1.16.0

func (mvpMaxVersionsGCPolicy) String()string

typeMetricsProvideradded inv1.27.0

type MetricsProvider interface {// contains filtered or unexported methods}

MetricsProvider is a wrapper for built in metrics meter provider

typeMinAggregatoradded inv1.28.0

type MinAggregator struct{}

MinAggregator is an aggregation function that finds the minimum between the input and the accumulator.

typeMultiClusterRoutingUseAnyAffinityadded inv1.37.0

type MultiClusterRoutingUseAnyAffinity interface {// contains filtered or unexported methods}

MultiClusterRoutingUseAnyAffinity represents the configuration for a specific affinity strategy.

typeMultiClusterRoutingUseAnyConfigadded inv1.37.0

type MultiClusterRoutingUseAnyConfig struct {// The set of clusters to route to. The order is ignored; clusters will be// tried in order of distance. If left empty, all clusters are eligible.ClusterIDs []string// Possible algorithms for routing affinity. If enabled, Bigtable will// route between equidistant clusters in a deterministic order rather than// choosing randomly.AffinityMultiClusterRoutingUseAnyAffinity}

MultiClusterRoutingUseAnyConfig is a policy whererin read/write requests arerouted to the nearest cluster in the instance, andwill fail over to the nearest cluster that is available in the event oftransient errors or delays. Clusters in a region are consideredequidistant. Choosing this option sacrifices read-your-writes consistencyto improve availability.

typeMutation

type Mutation struct {// contains filtered or unexported fields}

Mutation represents a set of changes for a single row of a table.

funcNewCondMutation

func NewCondMutation(condFilter, mtrue, mfalse *Mutation) *Mutation

NewCondMutation returns a conditional mutation.The given row filter determines which mutation is applied:If the filter matches any cell in the row, mtrue is applied;otherwise, mfalse is applied.Either given mutation may be nil.

The application of a ReadModifyWrite is atomic; concurrent ReadModifyWrites willbe executed serially by the server.

funcNewMutation

func NewMutation() *Mutation

NewMutation returns a new mutation.

func (*Mutation)AddIntToCelladded inv1.22.0

func (m *Mutation) AddIntToCell(family, columnstring, tsTimestamp, valueint64)

AddIntToCell adds an int64 value to a cell in an aggregate column family. The column family musthave an input type of Int64 or this mutation will fail.

func (*Mutation)DeleteCellsInColumn

func (m *Mutation) DeleteCellsInColumn(family, columnstring)

DeleteCellsInColumn will delete all the cells whose columns are family:column.

func (*Mutation)DeleteCellsInFamily

func (m *Mutation) DeleteCellsInFamily(familystring)

DeleteCellsInFamily will delete all the cells whose columns are family:*.

func (*Mutation)DeleteRow

func (m *Mutation) DeleteRow()

DeleteRow deletes the entire row.

func (*Mutation)DeleteTimestampRange

func (m *Mutation) DeleteTimestampRange(family, columnstring, start, endTimestamp)

DeleteTimestampRange deletes all cells whose columns are family:columnand whose timestamps are in the half-open interval [start, end).If end is zero, it will be interpreted as infinity.The timestamps will be truncated to millisecond granularity.

func (*Mutation)MergeBytesToCelladded inv1.28.0

func (m *Mutation) MergeBytesToCell(family, columnstring, tsTimestamp, value []byte)

MergeBytesToCell merges a bytes accumulator value to a cell in an aggregate column family.

func (*Mutation)Set

func (m *Mutation) Set(family, columnstring, tsTimestamp, value []byte)

Set sets a value in a specified column, with the given timestamp.The timestamp will be truncated to millisecond granularity.A timestamp of ServerTime means to use the server timestamp.

typeNodeScalingFactoradded inv1.36.0

type NodeScalingFactorint32

NodeScalingFactor controls the scaling factor of the cluster (i.e. theincrement in which NumNodes can be set). Node scaling delivers betterlatency and more throughput by removing node boundaries.

const (// NodeScalingFactorUnspecified default to 1X.NodeScalingFactorUnspecifiedNodeScalingFactor =iota// NodeScalingFactor1X runs the cluster with a scaling factor of 1.NodeScalingFactor1X// NodeScalingFactor2X runs the cluster with a scaling factor of 2.// All node count values must be in increments of 2 with this scaling// factor enabled, otherwise an INVALID_ARGUMENT error will be returned.NodeScalingFactor2X)

typeNoopMetricsProvideradded inv1.27.0

type NoopMetricsProvider struct{}

NoopMetricsProvider can be used to disable built in metrics

typePolicyTypeadded inv1.16.0

type PolicyTypeint

PolicyType represents the type of GCPolicy

const (// PolicyUnspecified represents type of NoGCPolicyPolicyUnspecifiedPolicyType =iota// PolicyMaxAge represents type of MaxAgeGCPolicyPolicyMaxAge// PolicyMaxVersion represents type of MaxVersionGCPolicyPolicyMaxVersion// PolicyUnion represents type of UnionGCPolicyPolicyUnion// PolicyIntersection represents type of IntersectionGCPolicyPolicyIntersection)

funcGetPolicyTypeadded inv1.16.0

func GetPolicyType(gcGCPolicy)PolicyType

GetPolicyType takes a gc policy and return appropriate PolicyType

typePrepareOptionadded inv1.36.0

type PrepareOption interface{}

PrepareOption can be passed while preparing a query statement.

typePreparedStatementadded inv1.36.0

type PreparedStatement struct {// contains filtered or unexported fields}

PreparedStatement stores the results of query preparation that can be used tocreate [BoundStatements]s to execute queries.

Whenever possible this should be shared across different instances of the same query,in order to amortize query preparation costs.

func (*PreparedStatement)Bindadded inv1.36.0

func (ps *PreparedStatement) Bind(values map[string]any) (*BoundStatement,error)

Bind binds a set of parameters to a prepared statement.

Allowed parameter value types are []byte, string, int64, float32, float64, bool,time.Time, civil.Date, array, slice and nil

typeProfileAttrsToUpdate

type ProfileAttrsToUpdate struct {// If set, updates the description.Descriptionoptional.String// If set, updates the routing policy.// Takes precedence over deprecated RoutingPolicy, ClusterID and AllowTransactionalWrites.RoutingConfigRoutingPolicyConfig// If set, updates the isolation options.IsolationAppProfileIsolation// If set, updates the routing policy.// Deprecated: Use RoutingConfig instead.RoutingPolicyoptional.String// If RoutingPolicy is updated to SingleClusterRouting, set this field as well.// Deprecated: Use RoutingConfig with SingleClusterRoutingConfig insteadClusterIDstring// If RoutingPolicy is updated to SingleClusterRouting, set this field as well.// Deprecated: Use RoutingConfig with SingleClusterRoutingConfig insteadAllowTransactionalWritesbool// If true, warnings are ignoredIgnoreWarningsbool}

ProfileAttrsToUpdate define addrs to update during an Update call. If unset, no fields will be replaced.

func (*ProfileAttrsToUpdate)GetFieldMaskPath

func (p *ProfileAttrsToUpdate) GetFieldMaskPath() []string

GetFieldMaskPath returns the field mask path.

typeProfileConf

type ProfileConf struct {NamestringProfileIDstringInstanceIDstringEtagstringDescriptionstringRoutingConfigRoutingPolicyConfigIsolationAppProfileIsolation// Deprecated: Use RoutingConfig instead.// Ignored when RoutingConfig is set.RoutingPolicystring// Deprecated: Use RoutingConfig with SingleClusterRoutingConfig instead.// Ignored when RoutingConfig is set.// To use with RoutingPolicy field while specifying SingleClusterRouting.ClusterIDstring// Deprecated: Use RoutingConfig with SingleClusterRoutingConfig instead.// Ignored when RoutingConfig is set.// To use with RoutingPolicy field while specifying SingleClusterRouting.AllowTransactionalWritesbool// If true, warnings are ignoredIgnoreWarningsbool}

ProfileConf contains the information necessary to create a profile

typeProfileIterator

type ProfileIterator struct {// contains filtered or unexported fields}

ProfileIterator iterates over profiles.

func (*ProfileIterator)Next

func (it *ProfileIterator) Next() (*btapb.AppProfile,error)

Next returns the next result. Its second return value is iterator.Done(https://godoc.org/google.golang.org/api/iterator) if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.

func (*ProfileIterator)PageInfo

func (it *ProfileIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. Seehttps://godoc.org/google.golang.org/api/iterator package for details.

typeProtoSchemaInfoadded inv1.39.0

type ProtoSchemaInfo struct {// Contains a protobuf-serialized// [google.protobuf.FileDescriptorSet](https://github.com/protocolbuffers/protobuf/blob/main/src/google/protobuf/descriptor.proto),// which could include multiple proto files.ProtoDescriptors []byte}

ProtoSchemaInfo represents a protobuf schema.

typeRawBytesEncodingadded inv1.22.0

type RawBytesEncoding struct {}

RawBytesEncoding represents a Bytes encoding with no additional encodings.

typeReadItem

type ReadItem struct {Row, ColumnstringTimestampTimestampValue       []byteLabels      []string}

A ReadItem is returned by Read. A ReadItem contains data from a specific row and column.

typeReadIterationStatsadded inv1.18.0

type ReadIterationStats struct {// The cells returned as part of the request.CellsReturnedCountint64// The cells seen (scanned) as part of the request. This includes the count of cells returned, as// captured below.CellsSeenCountint64// The rows returned as part of the request.RowsReturnedCountint64// The rows seen (scanned) as part of the request. This includes the count of rows returned, as// captured below.RowsSeenCountint64}

ReadIterationStats captures information about the iteration of rows or cells over the course ofa read, e.g. how many results were scanned in a read operation versus the results returned.

typeReadModifyWrite

type ReadModifyWrite struct {// contains filtered or unexported fields}

ReadModifyWrite represents a set of operations on a single row of a table.It is like Mutation but for non-idempotent changes.When applied, these operations operate on the latest values of the row's cells,and result in a new value being written to the relevant cell with a timestampthat is max(existing timestamp, current server time).

The application of a ReadModifyWrite is atomic; concurrent ReadModifyWrites willbe executed serially by the server.

funcNewReadModifyWrite

func NewReadModifyWrite() *ReadModifyWrite

NewReadModifyWrite returns a new ReadModifyWrite.

func (*ReadModifyWrite)AppendValue

func (m *ReadModifyWrite) AppendValue(family, columnstring, v []byte)

AppendValue appends a value to a specific cell's value.If the cell is unset, it will be treated as an empty value.

func (*ReadModifyWrite)Increment

func (m *ReadModifyWrite) Increment(family, columnstring, deltaint64)

Increment interprets the value in a specific cell as a 64-bit big-endian signed integer,and adds a value to it. If the cell is unset, it will be treated as zero.If the cell is set and is not an 8-byte value, the entire ApplyReadModifyWriteoperation will fail.

typeReadOption

type ReadOption interface {// contains filtered or unexported methods}

A ReadOption is an optional argument to ReadRows.

funcLimitRows

func LimitRows(limitint64)ReadOption

LimitRows returns a ReadOption that will end the number of rows to be read.

funcReverseScanadded inv1.21.0

func ReverseScan()ReadOption

ReverseScan returns a RadOption that will reverse the results of a Scan.The rows will be streamed in reverse lexiographic order of the keys. The row key ranges of the RowSet arestill expected to be oriented the same way as forwards. ie [a,c] where a <= c. The row contentwill remain unchanged from the ordering forward scans. This is particularly useful to get thelast N records before a key:

table.ReadRows(ctx, NewOpenClosedRange("", "key"), func(row bigtable.Row) bool {   return true}, bigtable.ReverseScan(), bigtable.LimitRows(10))

funcRowFilter

func RowFilter(fFilter)ReadOption

RowFilter returns a ReadOption that applies f to the contents of read rows.

If multiple RowFilters are provided, only the last is used. To combine filters,use ChainFilters or InterleaveFilters instead.

funcWithFullReadStatsadded inv1.18.0

func WithFullReadStats(fFullReadStatsFunc)ReadOption

WithFullReadStats returns a ReadOption that will request FullReadStatsand invoke the given callback on the resulting FullReadStats.

typeRequestLatencyStatsadded inv1.18.0

type RequestLatencyStats struct {// The latency measured by the frontend server handling this request, from when the request was// received, to when this value is sent back in the response. For more context on the component// that is measuring this latency, see:https://cloud.google.com/bigtable/docs/overviewFrontendServerLatencytime.Duration}

RequestLatencyStats provides a measurement of the latency of the request as it interacts withdifferent systems over its lifetime, e.g. how long the request took to execute within a frontendserver.

typeResultRowadded inv1.36.0

type ResultRow struct {Metadata *ResultRowMetadata// contains filtered or unexported fields}

ResultRow represents a single row in the result set returned on executing a GoogleSQL query in Cloud Bigtable

func (*ResultRow)GetByIndexadded inv1.36.0

func (rr *ResultRow) GetByIndex(indexint, destany)error

GetByIndex returns the value of the column at the specified zero-based index and stores itin the value pointed to by dest.

The dest argument must be a non-nil pointer.It performs basic type conversions. It converts columns to the following Go types where possible:

  • string
  • []byte
  • int64 (and other integer types like int, int32, uint64 etc.)
  • float32, float64
  • bool
  • time.Time (for TIMESTAMP)
  • civil.Date (for DATE)
  • Slice types (e.g., []string, []int64) for ARRAY
  • Map types (e.g., map[string]any) for MAP
  • Struct for STRUCT
  • any (interface{})
  • Pointers to the above types

SQL NULL values are converted to Go nil, which can only beassigned to pointer types (*T), interfaces (any), or other nillable types (slices, maps).Attempting to scan a SQL NULL into a non-nillable Go type (like int64, string, bool)will result in an error.

For SQL ARRAY columns containing NULL elements, dest should typically be a pointerto a slice of pointers (e.g., *[]*int64) or a slice of interfaces (*[]any).Assigning to a non-pointer slice (e.g., *[]int64) will fail if the array contains NULLs.For SQL STRUCT or MAP columns, dest should typically be a pointer to a map type(e.g., *map[string]any, *map[string]*int64).

When (WITH_HISTORY=>TRUE) is used in the query, the value of versioned column is of the form []Structi.e. []{{"timestamp": <timestamp>, "value": <value> }, {"timestamp": <timestamp>, "value": <value> }}.

BYTES Keys in MAPs: For SQL MAP columns where the key type is `BYTES` (e.g., MAP<BYTES, INT64>),the Go map representation assigned to dest will use `string` keys. These string keys are theBase64 standard encoding of the original `BYTES` keys. This conversion is necessary due toGo's map key restrictions. Callers interacting with these maps must Base64 encode their`[]byte` keys when performing lookups.

Returns an error if the index is out of bounds, dest is invalid (nil, not a pointer,pointer to struct other than time.Time and civil.Date), or if a type conversion fails.

func (*ResultRow)GetByNameadded inv1.36.0

func (rr *ResultRow) GetByName(namestring, destany)error

GetByName returns the value of the column with the specified nameand stores it in the value pointed to by dest. Column name matching is case-sensitive.

See the documentation forResultRow.GetByIndex for details on destination types, NULL handling,and type conversions.

Returns an error if dest is invalid, if a type conversion fails or if no/multiple columns with thespecified name are found.

typeResultRowMetadataadded inv1.36.0

type ResultRowMetadata struct {// the order of values returned by [ResultRow.Scan].Columns []ColumnMetadata// contains filtered or unexported fields}

ResultRowMetadata provides information about the schema of the ResultRow

typeRoutingPolicyConfigadded inv1.37.0

type RoutingPolicyConfig interface {// contains filtered or unexported methods}

RoutingPolicyConfig represents the configuration for a specific routing policy.

typeRow

type Row map[string][]ReadItem

A Row is returned by ReadRows. The map is keyed by column family (the prefixof the column name before the colon). The values are the returned ReadItemsfor that column family in the order returned by Read.

func (Row)Key

func (rRow) Key()string

Key returns the row's key, or "" if the row is empty.

typeRowAffinityadded inv1.37.0

type RowAffinity struct{}

RowAffinity enables row-based affinity.If enabled, Bigtable will route the request based on the row key of therequest, rather than randomly. Instead, each row key will be assignedto a cluster, and will stick to that cluster.

typeRowList

type RowList []string

RowList is a sequence of row keys.

typeRowRange

type RowRange struct {// contains filtered or unexported fields}

A RowRange describes a range of rows between the start and end key. Start andend keys may be rangeOpen, rangeClosed or rangeUnbounded.

funcInfiniteRange

func InfiniteRange(startstring)RowRange

InfiniteRange returns the RowRange consisting of all keys at least aslarge as start: [start, ∞).

funcInfiniteReverseRangeadded inv1.21.0

func InfiniteReverseRange(endstring)RowRange

InfiniteReverseRange returns the RowRange consisting of all keys less than orequal to the end: (∞, end].

funcNewClosedOpenRangeadded inv1.21.0

func NewClosedOpenRange(start, endstring)RowRange

NewClosedOpenRange returns the RowRange consisting of all greater than orequal to the start and less than the end: [start, end).

funcNewClosedRangeadded inv1.21.0

func NewClosedRange(start, endstring)RowRange

NewClosedRange returns the RowRange consisting of all keys greater than orequal to the start and less than or equal to the end: [start, end].

funcNewOpenClosedRangeadded inv1.21.0

func NewOpenClosedRange(start, endstring)RowRange

NewOpenClosedRange returns the RowRange consisting of all keys greater thanthe start and less than or equal to the end: (start, end].

funcNewOpenRangeadded inv1.21.0

func NewOpenRange(start, endstring)RowRange

NewOpenRange returns the RowRange consisting of all keys greater than thestart and less than the end: (start, end).

funcNewRange

func NewRange(begin, endstring)RowRange

NewRange returns the new RowRange [begin, end).

funcPrefixRange

func PrefixRange(prefixstring)RowRange

PrefixRange returns a RowRange consisting of all keys starting with the prefix.

func (RowRange)Contains

func (rRowRange) Contains(rowstring)bool

Contains says whether the RowRange contains the key.

func (RowRange)String

func (rRowRange) String()string

String provides a printable description of a RowRange.

func (RowRange)Unbounded

func (rRowRange) Unbounded()bool

Unbounded tests whether a RowRange is unbounded.

typeRowRangeList

type RowRangeList []RowRange

RowRangeList is a sequence of RowRanges representing the union of the ranges.

typeRowSet

type RowSet interface {// contains filtered or unexported methods}

RowSet is a set of rows to be read. It is satisfied by RowList, RowRange and RowRangeList.The serialized size of the ReadRowsRequest that uses this RowSet must be no larger than 512KB.Seehttps://docs.cloud.google.com/bigtable/docs/reads#large-rows for more information.

funcSingleRow

func SingleRow(rowstring)RowSet

SingleRow returns a RowSet for reading a single row.

typeSQLTypeadded inv1.36.0

type SQLType interface {// contains filtered or unexported methods}

SQLType represents the type of data that can be used to query Cloud Bigtable.It is based on the GoogleSQL standard.

typeSchemaBundleConfadded inv1.39.0

type SchemaBundleConf struct {TableIDstringSchemaBundleIDstringProtoSchema    *ProtoSchemaInfo// Etag is used for optimistic concurrency control during updates.// Ignored during creation.Etagstring}

SchemaBundleConf contains the information necessary to create or update a schema bundle.

typeSchemaBundleInfoadded inv1.39.0

type SchemaBundleInfo struct {TableIDstringSchemaBundleIDstringEtagstringSchemaBundle []byte}

SchemaBundleInfo represents information about a schema bundle. Schema bundle is a named collection of related schemas.This struct is read-only.

typeSingleClusterRoutingConfigadded inv1.37.0

type SingleClusterRoutingConfig struct {// The cluster to which read/write requests should be routed.ClusterIDstring// Whether or not `CheckAndMutateRow` and `ReadModifyWriteRow` requests are// allowed by this app profile. It is unsafe to send these requests to// the same table/row/column in multiple clusters.AllowTransactionalWritesbool}

SingleClusterRoutingConfig is a policy that unconditionally routes allread/write requests to a specific cluster. This option preservesread-your-writes consistency, but does not improve availability.

typeSnapshotInfo

type SnapshotInfo struct {NamestringSourceTablestringDataSizeint64CreateTimetime.TimeDeleteTimetime.Time}

SnapshotInfo contains snapshot metadata.

typeSnapshotIterator

type SnapshotIterator struct {// contains filtered or unexported fields}

SnapshotIterator is an EntryIterator that iterates over log entries.

This is a private alpha release of Cloud Bigtable snapshots. This featureis not currently available to most Cloud Bigtable customers. This featuremight be changed in backward-incompatible ways and is not recommended forproduction use. It is not subject to any SLA or deprecation policy.

func (*SnapshotIterator)Next

func (it *SnapshotIterator) Next() (*SnapshotInfo,error)

Next returns the next result. Its second return value is iterator.Done(https://godoc.org/google.golang.org/api/iterator) if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.

func (*SnapshotIterator)PageInfo

func (it *SnapshotIterator) PageInfo() *iterator.PageInfo

PageInfo supports pagination. Seehttps://godoc.org/google.golang.org/api/iterator package for details.

typeStandardIsolationadded inv1.37.0

type StandardIsolation struct {PriorityAppProfilePriority}

StandardIsolation configures standard traffic isolation.

typeStatusadded inv1.9.0

type Status =status.Status

Status references google.golang.org/grpc/status.It represents an RPC status code, message, and details of EncryptionInfo.https://pkg.go.dev/google.golang.org/grpc/internal/status

typeStorageType

type StorageTypeint

StorageType is the type of storage used for all tables in an instance

const (SSDStorageType =iotaHDD)

typeStringEncodingadded inv1.25.0

type StringEncoding interface {// contains filtered or unexported methods}

StringEncoding represents the encoding of a String.

typeStringSQLTypeadded inv1.36.0

type StringSQLType struct{}

StringSQLType represents a string.

typeStringTypeadded inv1.25.0

type StringType struct {EncodingStringEncoding}

StringType represents a string

typeStringUtf8BytesEncodingadded inv1.32.0

type StringUtf8BytesEncoding struct{}

StringUtf8BytesEncoding represents an UTF-8 bytes encoding for a string.

typeStringUtf8Encodingadded inv1.25.0

type StringUtf8Encoding struct{}

StringUtf8Encoding represents an UTF-8 raw encoding for a string.DEPRECATED: Please use StringUtf8BytesEncoding.

typeStructadded inv1.36.0

type Struct struct {// contains filtered or unexported fields}

Struct represents a value read from a SQL STRUCT column.It preserves the original order and names of the fields from the STRUCT definition,correctly handling duplicate names and unnamed fields (where Name=="").Use the provided methods (Field, Value, ValueByName, etc.) to access field data.

func (Struct)GetByIndexadded inv1.36.0

func (sStruct) GetByIndex(indexint, destany)error

GetByIndex returns the value of the field at the specified zero-based indexand stores it in the value pointed to by dest.

The dest argument must be a non-nil pointer. See documentation forResultRow.GetByIndex for details on type conversions and NULL handling performedduring assignment.Returns an error if the index is out of bounds, dest is invalid, or assignment fails.

func (Struct)GetByNameadded inv1.36.0

func (sStruct) GetByName(namestring, destany)error

GetByName returns the value of the field matching the specified name(case-sensitive) and stores it in the value pointed to by dest.

The dest argument must be a non-nil pointer. See documentation forResultRow.GetByIndex for details on type conversions and NULL handling performedduring assignment.Returns an error if no/multiple field matches the name, dest is invalid, or assignment fails.

func (Struct)Lenadded inv1.36.0

func (sStruct) Len()int

Len returns the number of fields in the Struct.

typeStructDelimitedBytesEncodingadded inv1.36.0

type StructDelimitedBytesEncoding struct {Delimiter []byte}

StructDelimitedBytesEncoding represents a delimited bytes struct encoding,where each field will be individually encoded and concatenated by thedelimiter in the middle.

typeStructEncodingadded inv1.36.0

type StructEncoding interface {// contains filtered or unexported methods}

StructEncoding represents the encoding of a struct type.

typeStructFieldadded inv1.36.0

type StructField struct {FieldNamestringFieldTypeType}

StructField represents a field within a StructType.

typeStructOrderedCodeBytesEncodingadded inv1.36.0

type StructOrderedCodeBytesEncoding struct{}

StructOrderedCodeBytesEncoding an encoding where each field will beindividually encoded. Each null byte (0x00) in the encoded fields will beescaped by 0xff before concatenate together by this {0x00, 0x01} byte sequence.

typeStructSQLFieldadded inv1.36.0

type StructSQLField struct {NamestringTypeSQLType}

StructSQLField defines a single named and typed field within a StructSQLType.

typeStructSQLTypeadded inv1.36.0

type StructSQLType struct {// Fields defines the ordered sequence of fields within the struct parameter.Fields []StructSQLField}

StructSQLType represents a struct with named fields for query parameters.Field order specified in `Fields` is significant for the protobuf representation.Struct values in result rows are typically represented as map[string]any.

typeStructSingletonEncodingadded inv1.36.0

type StructSingletonEncoding struct{}

StructSingletonEncoding represents a singleton struct encoding where this modeonly accepts a single field.

typeStructTypeadded inv1.36.0

type StructType struct {Fields   []StructFieldEncodingStructEncoding}

StructType represents a struct type.

typeSubsetViewConfadded inv1.23.0

type SubsetViewConf struct {RowPrefixes   [][]byteFamilySubsets map[string]FamilySubset}

SubsetViewConf contains configuration specific to an authorized view of subset view type.

func (*SubsetViewConf)AddFamilySubsetQualifieradded inv1.23.0

func (s *SubsetViewConf) AddFamilySubsetQualifier(familyNamestring, qualifier []byte)

AddFamilySubsetQualifier adds an individual column qualifier to be included in a subset view.

func (*SubsetViewConf)AddFamilySubsetQualifierPrefixadded inv1.23.0

func (s *SubsetViewConf) AddFamilySubsetQualifierPrefix(familyNamestring, qualifierPrefix []byte)

AddFamilySubsetQualifierPrefix adds a prefix for column qualifiers to be included in a subset view.

func (*SubsetViewConf)AddRowPrefixadded inv1.23.0

func (s *SubsetViewConf) AddRowPrefix(prefix []byte)

AddRowPrefix adds a new row prefix to the subset view.

typeSubsetViewInfoadded inv1.23.0

type SubsetViewInfo struct {RowPrefixes   [][]byteFamilySubsets map[string]FamilySubset}

SubsetViewInfo contains read-only SubsetView metadata.

typeSumAggregatoradded inv1.22.0

type SumAggregator struct{}

SumAggregator is an aggregation function that sums inputs together into itsaccumulator.

typeTable

type Table struct {// contains filtered or unexported fields}

A Table refers to a table.

A Table is safe to use concurrently.

func (*Table)Apply

func (t *Table) Apply(ctxcontext.Context, rowstring, m *Mutation, opts ...ApplyOption) (errerror)

Apply mutates a row atomically. A mutation must contain at least oneoperation and at most 100000 operations.

func (*Table)ApplyBulk

func (t *Table) ApplyBulk(ctxcontext.Context, rowKeys []string, muts []*Mutation, opts ...ApplyOption) (errs []error, errerror)

ApplyBulk applies multiple Mutations.Each mutation is individually applied atomically,but the set of mutations may be applied in any order.

Two types of failures may occur. If the entire processfails, (nil, err) will be returned. If specific mutationsfail to apply, ([]err, nil) will be returned, and the errorswill correspond to the relevant rowKeys/muts arguments.

Conditional mutations cannot be applied in bulk and providing one will result in an error.

func (*Table)ApplyReadModifyWrite

func (t *Table) ApplyReadModifyWrite(ctxcontext.Context, rowstring, m *ReadModifyWrite) (Row,error)

ApplyReadModifyWrite applies a ReadModifyWrite to a specific row.It returns the newly written cells.

func (*Table)ReadRow

func (t *Table) ReadRow(ctxcontext.Context, rowstring, opts ...ReadOption) (Row,error)

ReadRow is a convenience implementation of a single-row reader.A missing row will return nil for both Row and error.

func (*Table)ReadRows

func (t *Table) ReadRows(ctxcontext.Context, argRowSet, f func(Row)bool, opts ...ReadOption) (errerror)

ReadRows reads rows from a table. f is called for each row.If f returns false, the stream is shut down and ReadRows returns.f owns its argument, and f is called serially in order by row key.f will be executed in the same Go routine as the caller.

By default, the yielded rows will contain all values in all cells.Use RowFilter to limit the cells returned.

func (*Table)SampleRowKeys

func (t *Table) SampleRowKeys(ctxcontext.Context) ([]string,error)

SampleRowKeys returns a sample of row keys in the table. The returned row keys will delimit contiguous sections ofthe table of approximately equal size, which can be used to break up the data for distributed tasks like mapreduces.

typeTableAPIadded inv1.23.0

type TableAPI interface {ReadRows(ctxcontext.Context, argRowSet, f func(Row)bool, opts ...ReadOption)errorReadRow(ctxcontext.Context, rowstring, opts ...ReadOption) (Row,error)SampleRowKeys(ctxcontext.Context) ([]string,error)Apply(ctxcontext.Context, rowstring, m *Mutation, opts ...ApplyOption)errorApplyBulk(ctxcontext.Context, rowKeys []string, muts []*Mutation, opts ...ApplyOption) ([]error,error)ApplyReadModifyWrite(ctxcontext.Context, rowstring, m *ReadModifyWrite) (Row,error)}

TableAPI interface allows existing data APIs to be applied to either an authorized view, a materialized view or a table.A materialized view is a read-only entity.

typeTableAutomatedBackupConfigadded inv1.24.0

type TableAutomatedBackupConfig interface {// contains filtered or unexported methods}

TableAutomatedBackupConfig generalizes automated backup configurations.Currently, the only supported type of automated backup configurationis TableAutomatedBackupPolicy.

typeTableAutomatedBackupPolicyadded inv1.24.0

type TableAutomatedBackupPolicy struct {// How long the automated backups should be retained. The only// supported value at this time is 3 days.RetentionPeriodoptional.Duration// How frequently automated backups should occur. The only// supported value at this time is 24 hours.Frequencyoptional.Duration}

TableAutomatedBackupPolicy defines an automated backup policy for a table.Use nil TableAutomatedBackupPolicy to disable Automated Backups on a table.Use nil for a specific field to ignore that field when updating the policy on a table.

typeTableConf

type TableConf struct {TableIDstringSplitKeys []string// DEPRECATED: Use ColumnFamilies instead.// Families is a map from family name to GCPolicy.// Only one of Families or ColumnFamilies may be set.Families map[string]GCPolicy// ColumnFamilies is a map from family name to family configuration.// Only one of Families or ColumnFamilies may be set.ColumnFamilies map[string]Family// DeletionProtection can be none, protected or unprotected// set to protected to make the table protected against data lossDeletionProtectionDeletionProtectionChangeStreamRetentionChangeStreamRetention// Configure an automated backup policy for the tableAutomatedBackupConfigTableAutomatedBackupConfig// Configure a row key schema for the tableRowKeySchema *StructType}

TableConf contains all the information necessary to create a table with column families.

typeTableInfo

type TableInfo struct {// DEPRECATED - This field is deprecated. Please use FamilyInfos instead.Families    []stringFamilyInfos []FamilyInfo// DeletionProtection indicates whether the table is protected against data loss// DeletionProtection could be None depending on the table view// for example when using NAME_ONLY, the response does not contain DeletionProtection and the value should be NoneDeletionProtectionDeletionProtectionChangeStreamRetentionChangeStreamRetentionAutomatedBackupConfigTableAutomatedBackupConfigRowKeySchema          *StructType}

TableInfo represents information about a table.

typeTimestamp

type Timestampint64

Timestamp is in units of microseconds since 1 January 1970.

const ServerTimeTimestamp = -1

ServerTime is a specific Timestamp that may be passed to (*Mutation).Set.It indicates that the server's timestamp should be used.

funcNow

func Now()Timestamp

Now returns the Timestamp representation of the current time on the client.

funcTime

func Time(ttime.Time)Timestamp

Time converts a time.Time into a Timestamp.

func (Timestamp)Time

func (tsTimestamp) Time()time.Time

Time converts a Timestamp into a time.Time.

func (Timestamp)TruncateToMilliseconds

func (tsTimestamp) TruncateToMilliseconds()Timestamp

TruncateToMilliseconds truncates a Timestamp to millisecond granularity,which is currently the only granularity supported.

typeTimestampEncodingadded inv1.36.0

type TimestampEncoding interface {// contains filtered or unexported methods}

TimestampEncoding represents the encoding of the Timestamp type.

typeTimestampSQLTypeadded inv1.36.0

type TimestampSQLType struct{}

TimestampSQLType represents a point in time.

typeTimestampTypeadded inv1.36.0

type TimestampType struct {EncodingTimestampEncoding}

TimestampType represents the timestamp.

typeTimestampUnixMicrosInt64Encodingadded inv1.36.0

type TimestampUnixMicrosInt64Encoding struct {UnixMicrosInt64EncodingInt64Encoding}

TimestampUnixMicrosInt64Encoding represents a timestamp encoding where thethe number of microseconds in the timestamp value since the Unix epochis encoded by the given Int64Encoding. Values must be microsecond-aligned.

typeTypeadded inv1.22.0

type Type interface {// contains filtered or unexported methods}

Type wraps the protobuf representation of a type. See the protobuf definitionfor more details on types.

funcProtoToTypeadded inv1.28.0

func ProtoToType(pb *btapb.Type)Type

ProtoToType converts a protobuf *btapb.Type to an instance of the Type interface, for use of the admin API.

funcUnmarshalJSONadded inv1.30.0

func UnmarshalJSON(data []byte) (Type,error)

UnmarshalJSON returns a Type object from json bytes.

typeTypeUnspecifiedadded inv1.32.0

type TypeUnspecified struct{}

TypeUnspecified represents the absence of a type.

typeUnionGCPolicyadded inv1.16.0

type UnionGCPolicy struct {// List of children policy in the unionChildren []GCPolicy}

UnionGCPolicy with list of children

func (UnionGCPolicy)Stringadded inv1.16.0

func (upUnionGCPolicy) String()string

typeUpdateAuthorizedViewConfadded inv1.23.0

type UpdateAuthorizedViewConf struct {AuthorizedViewConfAuthorizedViewConfIgnoreWarningsbool}

UpdateAuthorizedViewConf contains all the information necessary to update or partial update an authorized view.

typeUpdateFamilyOptionadded inv1.30.0

type UpdateFamilyOptionGCPolicyOption

UpdateFamilyOption is the interface to update family settings

typeUpdateInstanceResultsadded inv1.1.0

type UpdateInstanceResults struct {InstanceUpdatedboolCreatedClusters []stringDeletedClusters []stringUpdatedClusters []string}

UpdateInstanceResults contains information about thechanges made after invoking UpdateInstanceAndSyncClusters.

funcUpdateInstanceAndSyncClustersadded inv1.1.0

func UpdateInstanceAndSyncClusters(ctxcontext.Context, iac *InstanceAdminClient, conf *InstanceWithClustersConfig) (*UpdateInstanceResults,error)

UpdateInstanceAndSyncClusters updates an instance and its clusters, and will synchronize theclusters in the instance with the provided clusters, creating and deleting them as necessary.The provided InstanceWithClustersConfig is used as follows:

  • InstanceID is required
  • DisplayName and InstanceType are updated only if they are not empty
  • ClusterID is required for any provided cluster
  • Any cluster present in conf.Clusters but not part of the instance will be created using CreateClusterand the given ClusterConfig.
  • Any cluster missing from conf.Clusters but present in the instance will be removed from the instanceusing DeleteCluster.
  • Any cluster in conf.Clusters that also exists in the instance will beupdated either to contain the provided number of nodes or to use theprovided autoscaling config. If both the number of nodes and autoscalingare configured, autoscaling takes precedence. If the number of nodes is zeroand autoscaling is not provided in InstanceWithClustersConfig, the clusteris not updated.

This method may return an error after partially succeeding, for example if the instance is updatedbut a cluster update fails. If an error is returned, InstanceInfo and Clusters may be called todetermine the current state. The return UpdateInstanceResults will describe the work done by themethod, whether partial or complete.

func (*UpdateInstanceResults)Stringadded inv1.1.0

func (r *UpdateInstanceResults) String()string

typeUpdateSchemaBundleConfadded inv1.39.0

type UpdateSchemaBundleConf struct {SchemaBundleConfSchemaBundleConfIgnoreWarningsbool}

UpdateSchemaBundleConf contains all the information necessary to update or partial update a schema bundle.

typeUpdateTableConfadded inv1.17.0

type UpdateTableConf struct{}

UpdateTableConf is unused

Source Files

View all Source files

Directories

PathSynopsis
admin
apiv2
Package bttest contains test helpers for working with the bigtable package.
Package bttest contains test helpers for working with the bigtable package.
cmd
emulatorcommand
cbtemulator launches the in-memory Cloud Bigtable server on the given address.
cbtemulator launches the in-memory Cloud Bigtable server on the given address.
option
Package option contains common code for dealing with client options.
Package option contains common code for dealing with client options.
testproxycommand

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2026 Movatter.jp