Documentation ¶
Overview ¶
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.
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.
For information about setting deadlines, reusing contexts, and more please visit pkg.go.dev/cloud.google.com/go.
Index ¶
- func DefaultAuthScopes() []string
- type CallOptions
- type Client
- func (c *Client) Close() error
- func (c *Client) Connection() *grpc.ClientConn
- func (c *Client) CreateEntry(ctx context.Context, req *datacatalogpb.CreateEntryRequest, ...) (*datacatalogpb.Entry, error)
- func (c *Client) CreateEntryGroup(ctx context.Context, req *datacatalogpb.CreateEntryGroupRequest, ...) (*datacatalogpb.EntryGroup, error)
- func (c *Client) CreateTag(ctx context.Context, req *datacatalogpb.CreateTagRequest, ...) (*datacatalogpb.Tag, error)
- func (c *Client) CreateTagTemplate(ctx context.Context, req *datacatalogpb.CreateTagTemplateRequest, ...) (*datacatalogpb.TagTemplate, error)
- func (c *Client) CreateTagTemplateField(ctx context.Context, req *datacatalogpb.CreateTagTemplateFieldRequest, ...) (*datacatalogpb.TagTemplateField, error)
- func (c *Client) DeleteEntry(ctx context.Context, req *datacatalogpb.DeleteEntryRequest, ...) error
- func (c *Client) DeleteEntryGroup(ctx context.Context, req *datacatalogpb.DeleteEntryGroupRequest, ...) error
- func (c *Client) DeleteTag(ctx context.Context, req *datacatalogpb.DeleteTagRequest, ...) error
- func (c *Client) DeleteTagTemplate(ctx context.Context, req *datacatalogpb.DeleteTagTemplateRequest, ...) error
- func (c *Client) DeleteTagTemplateField(ctx context.Context, req *datacatalogpb.DeleteTagTemplateFieldRequest, ...) error
- func (c *Client) GetEntry(ctx context.Context, req *datacatalogpb.GetEntryRequest, ...) (*datacatalogpb.Entry, error)
- func (c *Client) GetEntryGroup(ctx context.Context, req *datacatalogpb.GetEntryGroupRequest, ...) (*datacatalogpb.EntryGroup, error)
- func (c *Client) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
- func (c *Client) GetTagTemplate(ctx context.Context, req *datacatalogpb.GetTagTemplateRequest, ...) (*datacatalogpb.TagTemplate, error)
- func (c *Client) ListEntries(ctx context.Context, req *datacatalogpb.ListEntriesRequest, ...) *EntryIterator
- func (c *Client) ListEntryGroups(ctx context.Context, req *datacatalogpb.ListEntryGroupsRequest, ...) *EntryGroupIterator
- func (c *Client) ListTags(ctx context.Context, req *datacatalogpb.ListTagsRequest, ...) *TagIterator
- func (c *Client) LookupEntry(ctx context.Context, req *datacatalogpb.LookupEntryRequest, ...) (*datacatalogpb.Entry, error)
- func (c *Client) RenameTagTemplateField(ctx context.Context, req *datacatalogpb.RenameTagTemplateFieldRequest, ...) (*datacatalogpb.TagTemplateField, error)
- func (c *Client) SearchCatalog(ctx context.Context, req *datacatalogpb.SearchCatalogRequest, ...) *SearchCatalogResultIterator
- func (c *Client) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
- func (c *Client) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, ...) (*iampb.TestIamPermissionsResponse, error)
- func (c *Client) UpdateEntry(ctx context.Context, req *datacatalogpb.UpdateEntryRequest, ...) (*datacatalogpb.Entry, error)
- func (c *Client) UpdateEntryGroup(ctx context.Context, req *datacatalogpb.UpdateEntryGroupRequest, ...) (*datacatalogpb.EntryGroup, error)
- func (c *Client) UpdateTag(ctx context.Context, req *datacatalogpb.UpdateTagRequest, ...) (*datacatalogpb.Tag, error)
- func (c *Client) UpdateTagTemplate(ctx context.Context, req *datacatalogpb.UpdateTagTemplateRequest, ...) (*datacatalogpb.TagTemplate, error)
- func (c *Client) UpdateTagTemplateField(ctx context.Context, req *datacatalogpb.UpdateTagTemplateFieldRequest, ...) (*datacatalogpb.TagTemplateField, error)
- type EntryGroupIterator
- type EntryIterator
- type SearchCatalogResultIterator
- type TagIterator
Examples ¶
- Client.CreateEntry
- Client.CreateEntryGroup
- Client.CreateTag
- Client.CreateTagTemplate
- Client.CreateTagTemplateField
- Client.DeleteEntry
- Client.DeleteEntryGroup
- Client.DeleteTag
- Client.DeleteTagTemplate
- Client.DeleteTagTemplateField
- Client.GetEntry
- Client.GetEntryGroup
- Client.GetIamPolicy
- Client.GetTagTemplate
- Client.ListEntries
- Client.ListEntryGroups
- Client.ListTags
- Client.LookupEntry
- Client.RenameTagTemplateField
- Client.SearchCatalog
- Client.SetIamPolicy
- Client.TestIamPermissions
- Client.UpdateEntry
- Client.UpdateEntryGroup
- Client.UpdateTag
- Client.UpdateTagTemplate
- Client.UpdateTagTemplateField
- NewClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultAuthScopes ¶
func DefaultAuthScopes() []string
DefaultAuthScopes reports the default set of authentication scopes to use with this package.
Types ¶
type CallOptions ¶
type CallOptions struct { SearchCatalog []gax.CallOption CreateEntryGroup []gax.CallOption GetEntryGroup []gax.CallOption UpdateEntryGroup []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 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.
type Client ¶
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.
func NewClient ¶
NewClient creates a new data catalog client.
Data Catalog API service allows clients to discover, understand, and manage their data.
Example ¶
package main import ( "context" datacatalog "cloud.google.com/go/datacatalog/apiv1" ) func main() { ctx := context.Background() c, err := datacatalog.NewClient(ctx) if err != nil { // TODO: Handle error. } // TODO: Use client. _ = c }
Output:
func (*Client) Close ¶
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*Client) Connection ¶
func (c *Client) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated.
func (*Client) CreateEntry ¶
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.
Example ¶
package main import ( "context" datacatalog "cloud.google.com/go/datacatalog/apiv1" datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1" ) func main() { // import datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1" ctx := context.Background() c, err := datacatalog.NewClient(ctx) if err != nil { // TODO: Handle error. } req := &datacatalogpb.CreateEntryRequest{ // TODO: Fill request struct fields. } resp, err := c.CreateEntry(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) CreateEntryGroup ¶
func (c *Client) CreateEntryGroup(ctx context.Context, req *datacatalogpb.CreateEntryGroupRequest, opts ...gax.CallOption) (*datacatalogpb.EntryGroup, error)
CreateEntryGroup creates an EntryGroup.
An entry group contains logically related entries together with Cloud Identity and Access Management policies that specify the users who can create, edit, and view entries within the entry group.
Data Catalog automatically creates an entry group for BigQuery entries (“@bigquery”) and Pub/Sub topics ("@pubsub"). Users create their own entry group to contain Cloud Storage fileset entries or custom type entries, and the IAM policies associated with those entries. Entry groups, like entries, can be searched.
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).
Example ¶
package main import ( "context" datacatalog "cloud.google.com/go/datacatalog/apiv1" datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1" ) func main() { // import datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1" ctx := context.Background() c, err := datacatalog.NewClient(ctx) if err != nil { // TODO: Handle error. } req := &datacatalogpb.CreateEntryGroupRequest{ // TODO: Fill request struct fields. } resp, err := c.CreateEntryGroup(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) CreateTag ¶
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/v1/projects.locations.entryGroups.entries.tags/create#path-parameters) and the tag template (at https://cloud.google.com/data-catalog/docs/reference/rest/v1/projects.locations.tagTemplates/create#path-parameters) used to create the tag must be from the same organization.
Example ¶
package main import ( "context" datacatalog "cloud.google.com/go/datacatalog/apiv1" datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1" ) func main() { // import datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1" ctx := context.Background() c, err := datacatalog.NewClient(ctx) if err != nil { // TODO: Handle error. } req := &datacatalogpb.CreateTagRequest{ // TODO: Fill request struct fields. } resp, err := c.CreateTag(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) CreateTagTemplate ¶
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).
Example ¶
package main import ( "context" datacatalog "cloud.google.com/go/datacatalog/apiv1" datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1" ) func main() { // import datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1" ctx := context.Background() c, err := datacatalog.NewClient(ctx) if err != nil { // TODO: Handle error. } req := &datacatalogpb.CreateTagTemplateRequest{ // TODO: Fill request struct fields. } resp, err := c.CreateTagTemplate(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) CreateTagTemplateField ¶
func (c *Client) CreateTagTemplateField(ctx context.Context, req *datacatalogpb.CreateTagTemplateFieldRequest, opts ...gax.CallOption) (*datacatalogpb.TagTemplateField, error)
CreateTagTemplateField creates a field in 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).
Example ¶
package main import ( "context" datacatalog "cloud.google.com/go/datacatalog/apiv1" datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1" ) func main() { // import datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1" ctx := context.Background() c, err := datacatalog.NewClient(ctx) if err != nil { // TODO: Handle error. } req := &datacatalogpb.CreateTagTemplateFieldRequest{ // TODO: Fill request struct fields. } resp, err := c.CreateTagTemplateField(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) DeleteEntry ¶
func (c *Client) DeleteEntry(ctx context.Context, req *datacatalogpb.DeleteEntryRequest, opts ...gax.CallOption) error
DeleteEntry deletes an existing entry. Only entries created through CreateEntry method can be deleted. Users should enable the Data Catalog API in the project identified by the name 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).
Example ¶
package main import ( "context" datacatalog "cloud.google.com/go/datacatalog/apiv1" datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1" ) func main() { ctx := context.Background() c, err := datacatalog.NewClient(ctx) if err != nil { // TODO: Handle error. } req := &datacatalogpb.DeleteEntryRequest{ // TODO: Fill request struct fields. } err = c.DeleteEntry(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*Client) DeleteEntryGroup ¶
func (c *Client) DeleteEntryGroup(ctx context.Context, req *datacatalogpb.DeleteEntryGroupRequest, opts ...gax.CallOption) error
DeleteEntryGroup deletes an EntryGroup. Only entry groups that do not contain entries can be deleted. Users should enable the Data Catalog API in the project identified by the name 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).
Example ¶
package main import ( "context" datacatalog "cloud.google.com/go/datacatalog/apiv1" datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1" ) func main() { ctx := context.Background() c, err := datacatalog.NewClient(ctx) if err != nil { // TODO: Handle error. } req := &datacatalogpb.DeleteEntryGroupRequest{ // TODO: Fill request struct fields. } err = c.DeleteEntryGroup(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*Client) DeleteTag ¶
func (c *Client) DeleteTag(ctx context.Context, req *datacatalogpb.DeleteTagRequest, opts ...gax.CallOption) error
DeleteTag deletes a tag.
Example ¶
package main import ( "context" datacatalog "cloud.google.com/go/datacatalog/apiv1" datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1" ) func main() { ctx := context.Background() c, err := datacatalog.NewClient(ctx) if err != nil { // TODO: Handle error. } req := &datacatalogpb.DeleteTagRequest{ // TODO: Fill request struct fields. } err = c.DeleteTag(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*Client) DeleteTagTemplate ¶
func (c *Client) DeleteTagTemplate(ctx context.Context, req *datacatalogpb.DeleteTagTemplateRequest, opts ...gax.CallOption) error
DeleteTagTemplate deletes a tag template and all tags using the template. Users should enable the Data Catalog API in the project identified by the name 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).
Example ¶
package main import ( "context" datacatalog "cloud.google.com/go/datacatalog/apiv1" datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1" ) func main() { ctx := context.Background() c, err := datacatalog.NewClient(ctx) if err != nil { // TODO: Handle error. } req := &datacatalogpb.DeleteTagTemplateRequest{ // TODO: Fill request struct fields. } err = c.DeleteTagTemplate(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*Client) DeleteTagTemplateField ¶
func (c *Client) DeleteTagTemplateField(ctx context.Context, req *datacatalogpb.DeleteTagTemplateFieldRequest, opts ...gax.CallOption) error
DeleteTagTemplateField deletes a field in a tag template and all uses of that field. Users should enable the Data Catalog API in the project identified by the name 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).
Example ¶
package main import ( "context" datacatalog "cloud.google.com/go/datacatalog/apiv1" datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1" ) func main() { ctx := context.Background() c, err := datacatalog.NewClient(ctx) if err != nil { // TODO: Handle error. } req := &datacatalogpb.DeleteTagTemplateFieldRequest{ // TODO: Fill request struct fields. } err = c.DeleteTagTemplateField(ctx, req) if err != nil { // TODO: Handle error. } }
Output:
func (*Client) GetEntry ¶
func (c *Client) GetEntry(ctx context.Context, req *datacatalogpb.GetEntryRequest, opts ...gax.CallOption) (*datacatalogpb.Entry, error)
GetEntry gets an entry.
Example ¶
package main import ( "context" datacatalog "cloud.google.com/go/datacatalog/apiv1" datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1" ) func main() { // import datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1" ctx := context.Background() c, err := datacatalog.NewClient(ctx) if err != nil { // TODO: Handle error. } req := &datacatalogpb.GetEntryRequest{ // TODO: Fill request struct fields. } resp, err := c.GetEntry(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) GetEntryGroup ¶
func (c *Client) GetEntryGroup(ctx context.Context, req *datacatalogpb.GetEntryGroupRequest, opts ...gax.CallOption) (*datacatalogpb.EntryGroup, error)
GetEntryGroup gets an EntryGroup.
Example ¶
package main import ( "context" datacatalog "cloud.google.com/go/datacatalog/apiv1" datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1" ) func main() { // import datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1" ctx := context.Background() c, err := datacatalog.NewClient(ctx) if err != nil { // TODO: Handle error. } req := &datacatalogpb.GetEntryGroupRequest{ // TODO: Fill request struct fields. } resp, err := c.GetEntryGroup(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) GetIamPolicy ¶
func (c *Client) GetIamPolicy(ctx context.Context, req *iampb.GetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
GetIamPolicy gets the access control policy for a resource. A NOT_FOUND error is returned if the resource does not exist. An empty policy is returned if the resource exists but does not have a policy set on it.
Supported resources are:
Tag templates. Entries. Entry groups. Note, this method cannot be used to manage policies for BigQuery, Pub/Sub and any external Google Cloud Platform resources synced to Data Catalog.
Callers must have following Google IAM permission
datacatalog.tagTemplates.getIamPolicy to get policies on tag templates. datacatalog.entries.getIamPolicy to get policies on entries. datacatalog.entryGroups.getIamPolicy to get policies on entry groups.
Example ¶
package main import ( "context" datacatalog "cloud.google.com/go/datacatalog/apiv1" iampb "google.golang.org/genproto/googleapis/iam/v1" ) func main() { // import iampb "google.golang.org/genproto/googleapis/iam/v1" ctx := context.Background() c, err := datacatalog.NewClient(ctx) if err != nil { // TODO: Handle error. } req := &iampb.GetIamPolicyRequest{ // TODO: Fill request struct fields. } resp, err := c.GetIamPolicy(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) GetTagTemplate ¶
func (c *Client) GetTagTemplate(ctx context.Context, req *datacatalogpb.GetTagTemplateRequest, opts ...gax.CallOption) (*datacatalogpb.TagTemplate, error)
GetTagTemplate gets a tag template.
Example ¶
package main import ( "context" datacatalog "cloud.google.com/go/datacatalog/apiv1" datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1" ) func main() { // import datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1" ctx := context.Background() c, err := datacatalog.NewClient(ctx) if err != nil { // TODO: Handle error. } req := &datacatalogpb.GetTagTemplateRequest{ // TODO: Fill request struct fields. } resp, err := c.GetTagTemplate(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) ListEntries ¶
func (c *Client) ListEntries(ctx context.Context, req *datacatalogpb.ListEntriesRequest, opts ...gax.CallOption) *EntryIterator
ListEntries lists entries.
Example ¶
package main import ( "context" datacatalog "cloud.google.com/go/datacatalog/apiv1" "google.golang.org/api/iterator" datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1" ) func main() { // import datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1" // import "google.golang.org/api/iterator" ctx := context.Background() c, err := datacatalog.NewClient(ctx) if err != nil { // TODO: Handle error. } req := &datacatalogpb.ListEntriesRequest{ // TODO: Fill request struct fields. } it := c.ListEntries(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*Client) ListEntryGroups ¶
func (c *Client) ListEntryGroups(ctx context.Context, req *datacatalogpb.ListEntryGroupsRequest, opts ...gax.CallOption) *EntryGroupIterator
ListEntryGroups lists entry groups.
Example ¶
package main import ( "context" datacatalog "cloud.google.com/go/datacatalog/apiv1" "google.golang.org/api/iterator" datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1" ) func main() { // import datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1" // import "google.golang.org/api/iterator" ctx := context.Background() c, err := datacatalog.NewClient(ctx) if err != nil { // TODO: Handle error. } req := &datacatalogpb.ListEntryGroupsRequest{ // TODO: Fill request struct fields. } it := c.ListEntryGroups(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*Client) ListTags ¶
func (c *Client) ListTags(ctx context.Context, req *datacatalogpb.ListTagsRequest, opts ...gax.CallOption) *TagIterator
ListTags lists the tags on an Entry.
Example ¶
package main import ( "context" datacatalog "cloud.google.com/go/datacatalog/apiv1" "google.golang.org/api/iterator" datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1" ) func main() { // import datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1" // import "google.golang.org/api/iterator" ctx := context.Background() c, err := datacatalog.NewClient(ctx) if err != nil { // TODO: Handle error. } req := &datacatalogpb.ListTagsRequest{ // TODO: Fill request struct fields. } it := c.ListTags(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*Client) LookupEntry ¶
func (c *Client) LookupEntry(ctx context.Context, req *datacatalogpb.LookupEntryRequest, opts ...gax.CallOption) (*datacatalogpb.Entry, error)
LookupEntry get an entry by target resource name. This method allows clients to use the resource name from the source Google Cloud Platform service to get the Data Catalog Entry.
Example ¶
package main import ( "context" datacatalog "cloud.google.com/go/datacatalog/apiv1" datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1" ) func main() { // import datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1" ctx := context.Background() c, err := datacatalog.NewClient(ctx) if err != nil { // TODO: Handle error. } req := &datacatalogpb.LookupEntryRequest{ // TODO: Fill request struct fields. } resp, err := c.LookupEntry(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) RenameTagTemplateField ¶
func (c *Client) RenameTagTemplateField(ctx context.Context, req *datacatalogpb.RenameTagTemplateFieldRequest, opts ...gax.CallOption) (*datacatalogpb.TagTemplateField, error)
RenameTagTemplateField renames a field in a tag template. The user should enable the Data Catalog API in the project identified by the name parameter (see Data Catalog Resource Project (at https://cloud.google.com/data-catalog/docs/concepts/resource-project) for more information).
Example ¶
package main import ( "context" datacatalog "cloud.google.com/go/datacatalog/apiv1" datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1" ) func main() { // import datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1" ctx := context.Background() c, err := datacatalog.NewClient(ctx) if err != nil { // TODO: Handle error. } req := &datacatalogpb.RenameTagTemplateFieldRequest{ // TODO: Fill request struct fields. } resp, err := c.RenameTagTemplateField(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) SearchCatalog ¶
func (c *Client) SearchCatalog(ctx context.Context, req *datacatalogpb.SearchCatalogRequest, opts ...gax.CallOption) *SearchCatalogResultIterator
SearchCatalog searches Data Catalog for multiple resources like entries, tags that match a query.
This is a custom method (https://cloud.google.com/apis/design/custom_methods (at https://cloud.google.com/apis/design/custom_methods)) and does not return the complete resource, only the resource identifier and high level fields. Clients can subsequentally call Get methods.
Note that Data Catalog search queries do not guarantee full recall. Query results that match your query may not be returned, even in subsequent result pages. Also note that results returned (and not returned) can vary across repeated search queries.
See Data Catalog Search Syntax (at https://cloud.google.com/data-catalog/docs/how-to/search-reference) for more information.
Example ¶
package main import ( "context" datacatalog "cloud.google.com/go/datacatalog/apiv1" "google.golang.org/api/iterator" datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1" ) func main() { // import datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1" // import "google.golang.org/api/iterator" ctx := context.Background() c, err := datacatalog.NewClient(ctx) if err != nil { // TODO: Handle error. } req := &datacatalogpb.SearchCatalogRequest{ // TODO: Fill request struct fields. } it := c.SearchCatalog(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*Client) SetIamPolicy ¶
func (c *Client) SetIamPolicy(ctx context.Context, req *iampb.SetIamPolicyRequest, opts ...gax.CallOption) (*iampb.Policy, error)
SetIamPolicy sets the access control policy for a resource. Replaces any existing policy. Supported resources are:
Tag templates. Entries. Entry groups. Note, this method cannot be used to manage policies for BigQuery, Pub/Sub and any external Google Cloud Platform resources synced to Data Catalog.
Callers must have following Google IAM permission
datacatalog.tagTemplates.setIamPolicy to set policies on tag templates. datacatalog.entries.setIamPolicy to set policies on entries. datacatalog.entryGroups.setIamPolicy to set policies on entry groups.
Example ¶
package main import ( "context" datacatalog "cloud.google.com/go/datacatalog/apiv1" iampb "google.golang.org/genproto/googleapis/iam/v1" ) func main() { // import iampb "google.golang.org/genproto/googleapis/iam/v1" ctx := context.Background() c, err := datacatalog.NewClient(ctx) if err != nil { // TODO: Handle error. } req := &iampb.SetIamPolicyRequest{ // TODO: Fill request struct fields. } resp, err := c.SetIamPolicy(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) TestIamPermissions ¶
func (c *Client) TestIamPermissions(ctx context.Context, req *iampb.TestIamPermissionsRequest, opts ...gax.CallOption) (*iampb.TestIamPermissionsResponse, error)
TestIamPermissions returns the caller’s permissions on a resource. If the resource does not exist, an empty set of permissions is returned (We don’t return a NOT_FOUND error).
Supported resources are:
Tag templates. Entries. Entry groups. Note, this method cannot be used to manage policies for BigQuery, Pub/Sub and any external Google Cloud Platform resources synced to Data Catalog.
A caller is not required to have Google IAM permission to make this request.
Example ¶
package main import ( "context" datacatalog "cloud.google.com/go/datacatalog/apiv1" iampb "google.golang.org/genproto/googleapis/iam/v1" ) func main() { // import iampb "google.golang.org/genproto/googleapis/iam/v1" ctx := context.Background() c, err := datacatalog.NewClient(ctx) if err != nil { // TODO: Handle error. } req := &iampb.TestIamPermissionsRequest{ // TODO: Fill request struct fields. } resp, err := c.TestIamPermissions(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) UpdateEntry ¶
func (c *Client) UpdateEntry(ctx context.Context, req *datacatalogpb.UpdateEntryRequest, opts ...gax.CallOption) (*datacatalogpb.Entry, error)
UpdateEntry updates an existing entry. Users should enable the Data Catalog API in the project identified by the entry.name 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).
Example ¶
package main import ( "context" datacatalog "cloud.google.com/go/datacatalog/apiv1" datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1" ) func main() { // import datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1" ctx := context.Background() c, err := datacatalog.NewClient(ctx) if err != nil { // TODO: Handle error. } req := &datacatalogpb.UpdateEntryRequest{ // TODO: Fill request struct fields. } resp, err := c.UpdateEntry(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) UpdateEntryGroup ¶
func (c *Client) UpdateEntryGroup(ctx context.Context, req *datacatalogpb.UpdateEntryGroupRequest, opts ...gax.CallOption) (*datacatalogpb.EntryGroup, error)
UpdateEntryGroup updates an EntryGroup. The user should enable the Data Catalog API in the project identified by the entry_group.name 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).
Example ¶
package main import ( "context" datacatalog "cloud.google.com/go/datacatalog/apiv1" datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1" ) func main() { // import datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1" ctx := context.Background() c, err := datacatalog.NewClient(ctx) if err != nil { // TODO: Handle error. } req := &datacatalogpb.UpdateEntryGroupRequest{ // TODO: Fill request struct fields. } resp, err := c.UpdateEntryGroup(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) UpdateTag ¶
func (c *Client) UpdateTag(ctx context.Context, req *datacatalogpb.UpdateTagRequest, opts ...gax.CallOption) (*datacatalogpb.Tag, error)
UpdateTag updates an existing tag.
Example ¶
package main import ( "context" datacatalog "cloud.google.com/go/datacatalog/apiv1" datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1" ) func main() { // import datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1" ctx := context.Background() c, err := datacatalog.NewClient(ctx) if err != nil { // TODO: Handle error. } req := &datacatalogpb.UpdateTagRequest{ // TODO: Fill request struct fields. } resp, err := c.UpdateTag(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) UpdateTagTemplate ¶
func (c *Client) UpdateTagTemplate(ctx context.Context, req *datacatalogpb.UpdateTagTemplateRequest, opts ...gax.CallOption) (*datacatalogpb.TagTemplate, error)
UpdateTagTemplate updates a tag template. This method cannot be used to update the fields of a template. The tag template fields are represented as separate resources and should be updated using their own create/update/delete methods. Users should enable the Data Catalog API in the project identified by the tag_template.name 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).
Example ¶
package main import ( "context" datacatalog "cloud.google.com/go/datacatalog/apiv1" datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1" ) func main() { // import datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1" ctx := context.Background() c, err := datacatalog.NewClient(ctx) if err != nil { // TODO: Handle error. } req := &datacatalogpb.UpdateTagTemplateRequest{ // TODO: Fill request struct fields. } resp, err := c.UpdateTagTemplate(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) UpdateTagTemplateField ¶
func (c *Client) UpdateTagTemplateField(ctx context.Context, req *datacatalogpb.UpdateTagTemplateFieldRequest, opts ...gax.CallOption) (*datacatalogpb.TagTemplateField, error)
UpdateTagTemplateField updates a field in a tag template. This method cannot be used to update the field type. Users should enable the Data Catalog API in the project identified by the name 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).
Example ¶
package main import ( "context" datacatalog "cloud.google.com/go/datacatalog/apiv1" datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1" ) func main() { // import datacatalogpb "google.golang.org/genproto/googleapis/cloud/datacatalog/v1" ctx := context.Background() c, err := datacatalog.NewClient(ctx) if err != nil { // TODO: Handle error. } req := &datacatalogpb.UpdateTagTemplateFieldRequest{ // TODO: Fill request struct fields. } resp, err := c.UpdateTagTemplateField(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
type EntryGroupIterator ¶
type EntryGroupIterator struct { // Response is the raw response for the current page. // It must be cast to the RPC response type. // Calling Next() or InternalFetch() updates this value. Response interface{} // InternalFetch is for use by the Google Cloud Libraries only. // It is not part of the stable interface of this package. // // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. InternalFetch func(pageSize int, pageToken string) (results []*datacatalogpb.EntryGroup, nextPageToken string, err error) // contains filtered or unexported fields }
EntryGroupIterator manages a stream of *datacatalogpb.EntryGroup.
func (*EntryGroupIterator) Next ¶
func (it *EntryGroupIterator) Next() (*datacatalogpb.EntryGroup, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*EntryGroupIterator) PageInfo ¶
func (it *EntryGroupIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type EntryIterator ¶
type EntryIterator struct { // Response is the raw response for the current page. // It must be cast to the RPC response type. // Calling Next() or InternalFetch() updates this value. Response interface{} // InternalFetch is for use by the Google Cloud Libraries only. // It is not part of the stable interface of this package. // // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. InternalFetch func(pageSize int, pageToken string) (results []*datacatalogpb.Entry, nextPageToken string, err error) // contains filtered or unexported fields }
EntryIterator manages a stream of *datacatalogpb.Entry.
func (*EntryIterator) Next ¶
func (it *EntryIterator) Next() (*datacatalogpb.Entry, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*EntryIterator) PageInfo ¶
func (it *EntryIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type SearchCatalogResultIterator ¶
type SearchCatalogResultIterator struct { // Response is the raw response for the current page. // It must be cast to the RPC response type. // Calling Next() or InternalFetch() updates this value. Response interface{} // InternalFetch is for use by the Google Cloud Libraries only. // It is not part of the stable interface of this package. // // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. InternalFetch func(pageSize int, pageToken string) (results []*datacatalogpb.SearchCatalogResult, nextPageToken string, err error) // contains filtered or unexported fields }
SearchCatalogResultIterator manages a stream of *datacatalogpb.SearchCatalogResult.
func (*SearchCatalogResultIterator) Next ¶
func (it *SearchCatalogResultIterator) Next() (*datacatalogpb.SearchCatalogResult, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*SearchCatalogResultIterator) PageInfo ¶
func (it *SearchCatalogResultIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type TagIterator ¶
type TagIterator struct { // Response is the raw response for the current page. // It must be cast to the RPC response type. // Calling Next() or InternalFetch() updates this value. Response interface{} // InternalFetch is for use by the Google Cloud Libraries only. // It is not part of the stable interface of this package. // // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. InternalFetch func(pageSize int, pageToken string) (results []*datacatalogpb.Tag, nextPageToken string, err error) // contains filtered or unexported fields }
TagIterator manages a stream of *datacatalogpb.Tag.
func (*TagIterator) Next ¶
func (it *TagIterator) Next() (*datacatalogpb.Tag, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*TagIterator) PageInfo ¶
func (it *TagIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.