Package datacatalog is an auto-generated package for the Google Cloud Data Catalog API.
A fully managed and highly scalable data discovery and metadata management service.
NOTE: This package is in beta. It is not stable, and may be subject to changes.
General documentation
For information that is relevant for all client libraries please reference https://pkg.go.dev/cloud.google.com/go#pkg-overview. Some information on this page includes:
- Authentication and Authorization
- Timeouts and Cancellation
- Testing against Client Libraries
- Debugging Client Libraries
- Inspecting errors
Example usage
To get started with this package, create a client.
// go get cloud.google.com/go/datacatalog/apiv1beta1@latest ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := datacatalog.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close()
The client will use your default application credentials. Clients should be reused instead of created as needed. The methods of Client are safe for concurrent use by multiple goroutines. The returned client must be Closed when it is done being used.
Using the Client
The following is an example of making an API call with the newly created client, mentioned above.
req := &datacatalogpb.CreateEntryRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/datacatalog/apiv1beta1/datacatalogpb#CreateEntryRequest. } resp, err := c.CreateEntry(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp
Use of Context
The ctx passed to NewClient is used for authentication requests and for creating the underlying connection, but is not used for subsequent calls. Individual methods on the client use the ctx given to them.
To close the open connection, use the Close() method.
Functions
func DefaultAuthScopes
func DefaultAuthScopes() []string
DefaultAuthScopes reports the default set of authentication scopes to use with this package.
CallOptions
type CallOptions struct {
SearchCatalog []gax.CallOption
CreateEntryGroup []gax.CallOption
UpdateEntryGroup []gax.CallOption
GetEntryGroup []gax.CallOption
DeleteEntryGroup []gax.CallOption
ListEntryGroups []gax.CallOption
CreateEntry []gax.CallOption
UpdateEntry []gax.CallOption
DeleteEntry []gax.CallOption
GetEntry []gax.CallOption
LookupEntry []gax.CallOption
ListEntries []gax.CallOption
CreateTagTemplate []gax.CallOption
GetTagTemplate []gax.CallOption
UpdateTagTemplate []gax.CallOption
DeleteTagTemplate []gax.CallOption
CreateTagTemplateField []gax.CallOption
UpdateTagTemplateField []gax.CallOption
RenameTagTemplateField []gax.CallOption
RenameTagTemplateFieldEnumValue []gax.CallOption
DeleteTagTemplateField []gax.CallOption
CreateTag []gax.CallOption
UpdateTag []gax.CallOption
DeleteTag []gax.CallOption
ListTags []gax.CallOption
SetIamPolicy []gax.CallOption
GetIamPolicy []gax.CallOption
TestIamPermissions []gax.CallOption
}
CallOptions contains the retry settings for each method of Client.
Client (deprecated)
type Client struct {
// The call options for this service.
CallOptions *CallOptions
// contains filtered or unexported fields
}
Client is a client for interacting with Google Cloud Data Catalog API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Deprecated: Please use Dataplex Catalog instead.
Data Catalog API service allows clients to discover, understand, and manage their data.
Deprecated: DataCatalog may be removed in a future version.
func NewClient (deprecated)
NewClient creates a new data catalog client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Deprecated: Please use Dataplex Catalog instead.
Data Catalog API service allows clients to discover, understand, and manage their data.
Deprecated: DataCatalog may be removed in a future version.
Example
package main
import (
"context"
datacatalog "cloud.google.com/go/datacatalog/apiv1beta1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := datacatalog.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func NewRESTClient (deprecated)
NewRESTClient creates a new data catalog rest client.
Deprecated: Please use Dataplex Catalog instead.
Data Catalog API service allows clients to discover, understand, and manage their data.
Deprecated: DataCatalog may be removed in a future version.
Example
package main
import (
"context"
datacatalog "cloud.google.com/go/datacatalog/apiv1beta1"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := datacatalog.NewRESTClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
// TODO: Use client.
_ = c
}
func (*Client) Close (deprecated)
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*Client) Connection (deprecated)
func (c *Client) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*Client) CreateEntry (deprecated)
func (c *Client) CreateEntry(ctx context.Context, req *datacatalogpb.CreateEntryRequest, opts ...gax.CallOption) (*datacatalogpb.Entry, error)
CreateEntry creates an entry. Only entries of ‘FILESET’ type or user-specified type can be created.
Users should enable the Data Catalog API in the project identified by the parent parameter (see [Data Catalog Resource Project] (https://cloud.google.com/data-catalog/docs/concepts/resource-project (at https://cloud.google.com/data-catalog/docs/concepts/resource-project)) for more information).
A maximum of 100,000 entries may be created per entry group.
Deprecated: CreateEntry may be removed in a future version.
Example
package main
import (
"context"
datacatalog "cloud.google.com/go/datacatalog/apiv1beta1"
datacatalogpb "cloud.google.com/go/datacatalog/apiv1beta1/datacatalogpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := datacatalog.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datacatalogpb.CreateEntryRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/datacatalog/apiv1beta1/datacatalogpb#CreateEntryRequest.
}
resp, err := c.CreateEntry(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) CreateEntryGroup (deprecated)
func (c *Client) CreateEntryGroup(ctx context.Context, req *datacatalogpb.CreateEntryGroupRequest, opts ...gax.CallOption) (*datacatalogpb.EntryGroup, error)
CreateEntryGroup a maximum of 10,000 entry groups may be created per organization across all locations.
Users should enable the Data Catalog API in the project identified by the parent parameter (see [Data Catalog Resource Project] (https://cloud.google.com/data-catalog/docs/concepts/resource-project (at https://cloud.google.com/data-catalog/docs/concepts/resource-project)) for more information).
Deprecated: CreateEntryGroup may be removed in a future version.
Example
package main
import (
"context"
datacatalog "cloud.google.com/go/datacatalog/apiv1beta1"
datacatalogpb "cloud.google.com/go/datacatalog/apiv1beta1/datacatalogpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := datacatalog.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datacatalogpb.CreateEntryGroupRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/datacatalog/apiv1beta1/datacatalogpb#CreateEntryGroupRequest.
}
resp, err := c.CreateEntryGroup(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) CreateTag (deprecated)
func (c *Client) CreateTag(ctx context.Context, req *datacatalogpb.CreateTagRequest, opts ...gax.CallOption) (*datacatalogpb.Tag, error)
CreateTag creates a tag on an Entry. Note: The project identified by the parent parameter for the tag (at https://cloud.google.com/data-catalog/docs/reference/rest/v1beta1/projects.locations.entryGroups.entries.tags/create#path-parameters) and the tag template (at https://cloud.google.com/data-catalog/docs/reference/rest/v1beta1/projects.locations.tagTemplates/create#path-parameters) used to create the tag must be from the same organization.
Deprecated: CreateTag may be removed in a future version.
Example
package main
import (
"context"
datacatalog "cloud.google.com/go/datacatalog/apiv1beta1"
datacatalogpb "cloud.google.com/go/datacatalog/apiv1beta1/datacatalogpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := datacatalog.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datacatalogpb.CreateTagRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/datacatalog/apiv1beta1/datacatalogpb#CreateTagRequest.
}
resp, err := c.CreateTag(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) CreateTagTemplate (deprecated)
func (c *Client) CreateTagTemplate(ctx context.Context, req *datacatalogpb.CreateTagTemplateRequest, opts ...gax.CallOption) (*datacatalogpb.TagTemplate, error)
CreateTagTemplate creates a tag template. The user should enable the Data Catalog API in the project identified by the parent parameter (see Data Catalog Resource Project (at https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information).
Deprecated: CreateTagTemplate may be removed in a future version.
Example
package main
import (
"context"
datacatalog "cloud.google.com/go/datacatalog/apiv1beta1"
datacatalogpb "cloud.google.com/go/datacatalog/apiv1beta1/datacatalogpb"
)
func main() {
ctx := context.Background()
// This snippet has been automatically generated and should be regarded as a code template only.
// It will require modifications to work:
// - It may require correct/in-range values for request initialization.
// - It may require specifying regional endpoints when creating the service client as shown in:
// https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options
c, err := datacatalog.NewClient(ctx)
if err != nil {
// TODO: Handle error.
}
defer c.Close()
req := &datacatalogpb.CreateTagTemplateRequest{
// TODO: Fill request struct fields.
// See https://pkg.go.dev/cloud.google.com/go/datacatalog/apiv1beta1/datacatalogpb#CreateTagTemplateRequest.
}
resp, err := c.CreateTagTemplate(ctx, req)
if err != nil {
// TODO: Handle error.
}
// TODO: Use resp.
_ = resp
}
func (*Client) CreateTagTemplateField (deprecated)
func (c *Client) CreateTagTemplateField(ctx context.Context, req *datacatalogpb.