Managed Service for Apache Kafka API v1 - Package cloud.google.com/go/managedkafka/apiv1 (v0.8.1) Stay organized with collections Save and categorize content based on your preferences.
Beta
This library is covered by thePre-GA Offerings Terms of the Terms of Service. Pre-GA libraries might have limited support, and changes to pre-GA libraries might not be compatible with other pre-GA versions. For more information, see thelaunch stage descriptions.
Note: To get more information about this package, such as access to older versions, viewthis package on pkg.go.dev.Package managedkafka is an auto-generated package for theManaged Service for Apache Kafka API.
Manage Apache Kafka clusters and resources.
NOTE:Thispackageisinbeta.Itisnotstable,andmaybesubjecttochanges.
General documentation
For information that is relevant for all client libraries please referencehttps://pkg.go.dev/cloud.google.com/go#pkg-overview. Some information on thispage 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/managedkafka/apiv1@latestctx:=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_Optionsc,err:=managedkafka.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.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:=&managedkafkapb.AddAclEntryRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/managedkafka/apiv1/managedkafkapb#AddAclEntryRequest.}resp,err:=c.AddAclEntry(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp
Use of Context
The ctx passed to NewClient is used for authentication requests andfor 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
funcDefaultAuthScopes()[]stringDefaultAuthScopes reports the default set of authentication scopes to use with this package.
AclIterator
typeAclIteratorstruct{// 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.Responseinterface{}// 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.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*managedkafkapb.Acl,nextPageTokenstring,errerror)// contains filtered or unexported fields}AclIterator manages a stream of *managedkafkapb.Acl.
func (*AclIterator) All
func(it*AclIterator)All()iter.Seq2[*managedkafkapb.Acl,error]All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.
func (*AclIterator) Next
func(it*AclIterator)Next()(*managedkafkapb.Acl,error)Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.
func (*AclIterator) PageInfo
func(it*AclIterator)PageInfo()*iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
CallOptions
typeCallOptionsstruct{ListClusters[]gax.CallOptionGetCluster[]gax.CallOptionCreateCluster[]gax.CallOptionUpdateCluster[]gax.CallOptionDeleteCluster[]gax.CallOptionListTopics[]gax.CallOptionGetTopic[]gax.CallOptionCreateTopic[]gax.CallOptionUpdateTopic[]gax.CallOptionDeleteTopic[]gax.CallOptionListConsumerGroups[]gax.CallOptionGetConsumerGroup[]gax.CallOptionUpdateConsumerGroup[]gax.CallOptionDeleteConsumerGroup[]gax.CallOptionListAcls[]gax.CallOptionGetAcl[]gax.CallOptionCreateAcl[]gax.CallOptionUpdateAcl[]gax.CallOptionDeleteAcl[]gax.CallOptionAddAclEntry[]gax.CallOptionRemoveAclEntry[]gax.CallOptionGetLocation[]gax.CallOptionListLocations[]gax.CallOptionCancelOperation[]gax.CallOptionDeleteOperation[]gax.CallOptionGetOperation[]gax.CallOptionListOperations[]gax.CallOption}CallOptions contains the retry settings for each method of Client.
Client
typeClientstruct{// The call options for this service.CallOptions*CallOptions// LROClient is used internally to handle long-running operations.// It is exposed so that its CallOptions can be modified if required.// Users should not Close this client.LROClient*lroauto.OperationsClient// contains filtered or unexported fields}Client is a client for interacting with Managed Service for Apache Kafka API.Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The service that a client application uses to manage Apache Kafka clusters,topics and consumer groups.
func NewClient
NewClient creates a new managed kafka client based on gRPC.The returned client must be Closed when it is done being used to clean up its underlying connections.
The service that a client application uses to manage Apache Kafka clusters,topics and consumer groups.
Example
packagemainimport("context"managedkafka"cloud.google.com/go/managedkafka/apiv1")funcmain(){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_Optionsc,err:=managedkafka.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func NewRESTClient
NewRESTClient creates a new managed kafka rest client.
The service that a client application uses to manage Apache Kafka clusters,topics and consumer groups.
Example
packagemainimport("context"managedkafka"cloud.google.com/go/managedkafka/apiv1")funcmain(){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_Optionsc,err:=managedkafka.NewRESTClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func (*Client) AddAclEntry
func(c*Client)AddAclEntry(ctxcontext.Context,req*managedkafkapb.AddAclEntryRequest,opts...gax.CallOption)(*managedkafkapb.AddAclEntryResponse,error)AddAclEntry incremental update: Adds an acl entry to an acl. Creates the acl if it doesnot exist yet.
Example
packagemainimport("context"managedkafka"cloud.google.com/go/managedkafka/apiv1"managedkafkapb"cloud.google.com/go/managedkafka/apiv1/managedkafkapb")funcmain(){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_Optionsc,err:=managedkafka.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&managedkafkapb.AddAclEntryRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/managedkafka/apiv1/managedkafkapb#AddAclEntryRequest.}resp,err:=c.AddAclEntry(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*Client) CancelOperation
func(c*Client)CancelOperation(ctxcontext.Context,req*longrunningpb.CancelOperationRequest,opts...gax.CallOption)errorCancelOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"managedkafka"cloud.google.com/go/managedkafka/apiv1")funcmain(){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_Optionsc,err:=managedkafka.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.CancelOperationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.}err=c.CancelOperation(ctx,req)iferr!=nil{// TODO: Handle error.}}func (*Client) Close
Close closes the connection to the API service. The user should invoke this whenthe client is no longer required.
func (*Client) Connection (deprecated)
func(c*Client)Connection()*grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.
func (*Client) CreateAcl
func(c*Client)CreateAcl(ctxcontext.Context,req*managedkafkapb.CreateAclRequest,opts...gax.CallOption)(*managedkafkapb.Acl,error)CreateAcl creates a new acl in the given project, location, and cluster.
Example
packagemainimport("context"managedkafka"cloud.google.com/go/managedkafka/apiv1"managedkafkapb"cloud.google.com/go/managedkafka/apiv1/managedkafkapb")funcmain(){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_Optionsc,err:=managedkafka.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&managedkafkapb.CreateAclRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/managedkafka/apiv1/managedkafkapb#CreateAclRequest.}resp,err:=c.CreateAcl(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*Client) CreateCluster
func(c*Client)CreateCluster(ctxcontext.Context,req*managedkafkapb.CreateClusterRequest,opts...gax.CallOption)(*CreateClusterOperation,error)CreateCluster creates a new cluster in a given project and location.
Example
packagemainimport("context"managedkafka"cloud.google.com/go/managedkafka/apiv1"managedkafkapb"cloud.google.com/go/managedkafka/apiv1/managedkafkapb")funcmain(){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_Optionsc,err:=managedkafka.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&managedkafkapb.CreateClusterRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/managedkafka/apiv1/managedkafkapb#CreateClusterRequest.}op,err:=c.CreateCluster(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*Client) CreateClusterOperation
func(c*Client)CreateClusterOperation(namestring)*CreateClusterOperationCreateClusterOperation returns a new CreateClusterOperation from a given name.The name must be that of a previously created CreateClusterOperation, possibly from a different process.
func (*Client) CreateTopic
func(c*Client)CreateTopic(ctxcontext.Context,req*managedkafkapb.CreateTopicRequest,opts...gax.CallOption)(*managedkafkapb.Topic,error)CreateTopic creates a new topic in a given project and location.
Example
packagemainimport("context"managedkafka"cloud.google.com/go/managedkafka/apiv1"managedkafkapb"cloud.google.com/go/managedkafka/apiv1/managedkafkapb")funcmain(){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_Optionsc,err:=managedkafka.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&managedkafkapb.CreateTopicRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/managedkafka/apiv1/managedkafkapb#CreateTopicRequest.}resp,err:=c.CreateTopic(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*Client) DeleteAcl
func(c*Client)DeleteAcl(ctxcontext.Context,req*managedkafkapb.DeleteAclRequest,opts...gax.CallOption)errorDeleteAcl deletes an acl.
Example
packagemainimport("context"managedkafka"cloud.google.com/go/managedkafka/apiv1"managedkafkapb"cloud.google.com/go/managedkafka/apiv1/managedkafkapb")funcmain(){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_Optionsc,err:=managedkafka.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&managedkafkapb.DeleteAclRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/managedkafka/apiv1/managedkafkapb#DeleteAclRequest.}err=c.DeleteAcl(ctx,req)iferr!=nil{// TODO: Handle error.}}func (*Client) DeleteCluster
func(c*Client)DeleteCluster(ctxcontext.Context,req*managedkafkapb.DeleteClusterRequest,opts...gax.CallOption)(*DeleteClusterOperation,error)DeleteCluster deletes a single cluster.
Example
packagemainimport("context"managedkafka"cloud.google.com/go/managedkafka/apiv1"managedkafkapb"cloud.google.com/go/managedkafka/apiv1/managedkafkapb")funcmain(){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_Optionsc,err:=managedkafka.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&managedkafkapb.DeleteClusterRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/managedkafka/apiv1/managedkafkapb#DeleteClusterRequest.}op,err:=c.DeleteCluster(ctx,req)iferr!=nil{// TODO: Handle error.}err=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}}func (*Client) DeleteClusterOperation
func(c*Client)DeleteClusterOperation(namestring)*DeleteClusterOperationDeleteClusterOperation returns a new DeleteClusterOperation from a given name.The name must be that of a previously created DeleteClusterOperation, possibly from a different process.
func (*Client) DeleteConsumerGroup
func(c*Client)DeleteConsumerGroup(ctxcontext.Context,req*managedkafkapb.DeleteConsumerGroupRequest,opts...gax.CallOption)errorDeleteConsumerGroup deletes a single consumer group.
Example
packagemainimport("context"managedkafka"cloud.google.com/go/managedkafka/apiv1"managedkafkapb"cloud.google.com/go/managedkafka/apiv1/managedkafkapb")funcmain(){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_Optionsc,err:=managedkafka.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&managedkafkapb.DeleteConsumerGroupRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/managedkafka/apiv1/managedkafkapb#DeleteConsumerGroupRequest.}err=c.DeleteConsumerGroup(ctx,req)iferr!=nil{// TODO: Handle error.}}func (*Client) DeleteOperation
func(c*Client)DeleteOperation(ctxcontext.Context,req*longrunningpb.DeleteOperationRequest,opts...gax.CallOption)errorDeleteOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"managedkafka"cloud.google.com/go/managedkafka/apiv1")funcmain(){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_Optionsc,err:=managedkafka.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.DeleteOperationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.}err=c.DeleteOperation(ctx,req)iferr!=nil{// TODO: Handle error.}}func (*Client) DeleteTopic
func(c*Client)DeleteTopic(ctxcontext.Context,req*managedkafkapb.DeleteTopicRequest,opts...gax.CallOption)errorDeleteTopic deletes a single topic.
Example
packagemainimport("context"managedkafka"cloud.google.com/go/managedkafka/apiv1"managedkafkapb"cloud.google.com/go/managedkafka/apiv1/managedkafkapb")funcmain(){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_Optionsc,err:=managedkafka.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&managedkafkapb.DeleteTopicRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/managedkafka/apiv1/managedkafkapb#DeleteTopicRequest.}err=c.DeleteTopic(ctx,req)iferr!=nil{// TODO: Handle error.}}func (*Client) GetAcl
func(c*Client)GetAcl(ctxcontext.Context,req*managedkafkapb.GetAclRequest,opts...gax.CallOption)(*managedkafkapb.Acl,error)GetAcl returns the properties of a single acl.
Example
packagemainimport("context"managedkafka"cloud.google.com/go/managedkafka/apiv1"managedkafkapb"cloud.google.com/go/managedkafka/apiv1/managedkafkapb")funcmain(){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_Optionsc,err:=managedkafka.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&managedkafkapb.GetAclRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/managedkafka/apiv1/managedkafkapb#GetAclRequest.}resp,err:=c.GetAcl(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*Client) GetCluster
func(c*Client)GetCluster(ctxcontext.Context,req*managedkafkapb.GetClusterRequest,opts...gax.CallOption)(*managedkafkapb.Cluster,error)GetCluster returns the properties of a single cluster.
Example
packagemainimport("context"managedkafka"cloud.google.com/go/managedkafka/apiv1"managedkafkapb"cloud.google.com/go/managedkafka/apiv1/managedkafkapb")funcmain(){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_Optionsc,err:=managedkafka.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&managedkafkapb.GetClusterRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/managedkafka/apiv1/managedkafkapb#GetClusterRequest.}resp,err:=c.GetCluster(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*Client) GetConsumerGroup
func(c*Client)GetConsumerGroup(ctxcontext.Context,req*managedkafkapb.GetConsumerGroupRequest,opts...gax.CallOption)(*managedkafkapb.ConsumerGroup,error)GetConsumerGroup returns the properties of a single consumer group.
Example
packagemainimport("context"managedkafka"cloud.google.com/go/managedkafka/apiv1"managedkafkapb"cloud.google.com/go/managedkafka/apiv1/managedkafkapb")funcmain(){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_Optionsc,err:=managedkafka.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&managedkafkapb.GetConsumerGroupRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/managedkafka/apiv1/managedkafkapb#GetConsumerGroupRequest.}resp,err:=c.GetConsumerGroup(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*Client) GetLocation
func(c*Client)GetLocation(ctxcontext.Context,req*locationpb.GetLocationRequest,opts...gax.CallOption)(*locationpb.Location,error)GetLocation gets information about a location.
Example
packagemainimport("context"managedkafka"cloud.google.com/go/managedkafka/apiv1"locationpb"google.golang.org/genproto/googleapis/cloud/location")funcmain(){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_Optionsc,err:=managedkafka.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&locationpb.GetLocationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#GetLocationRequest.}resp,err:=c.GetLocation(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*Client) GetOperation
func(c*Client)GetOperation(ctxcontext.Context,req*longrunningpb.GetOperationRequest,opts...gax.CallOption)(*longrunningpb.Operation,error)GetOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"managedkafka"cloud.google.com/go/managedkafka/apiv1")funcmain(){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_Optionsc,err:=managedkafka.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.GetOperationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.}resp,err:=c.GetOperation(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*Client) GetTopic
func(c*Client)GetTopic(ctxcontext.Context,req*managedkafkapb.GetTopicRequest,opts...gax.CallOption)(*managedkafkapb.Topic,error)GetTopic returns the properties of a single topic.
Example
packagemainimport("context"managedkafka"cloud.google.com/go/managedkafka/apiv1"managedkafkapb"cloud.google.com/go/managedkafka/apiv1/managedkafkapb")funcmain(){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_Optionsc,err:=managedkafka.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&managedkafkapb.GetTopicRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/managedkafka/apiv1/managedkafkapb#GetTopicRequest.}resp,err:=c.GetTopic(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*Client) ListAcls
func(c*Client)ListAcls(ctxcontext.Context,req*managedkafkapb.ListAclsRequest,opts...gax.CallOption)*AclIteratorListAcls lists the acls in a given cluster.
Examples
packagemainimport("context"managedkafka"cloud.google.com/go/managedkafka/apiv1"managedkafkapb"cloud.google.com/go/managedkafka/apiv1/managedkafkapb""google.golang.org/api/iterator")funcmain(){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_Optionsc,err:=managedkafka.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&managedkafkapb.ListAclsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/managedkafka/apiv1/managedkafkapb#ListAclsRequest.}it:=c.ListAcls(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*managedkafkapb.ListAclsResponse)}}all
packagemainimport("context"managedkafka"cloud.google.com/go/managedkafka/apiv1"managedkafkapb"cloud.google.com/go/managedkafka/apiv1/managedkafkapb")funcmain(){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_Optionsc,err:=managedkafka.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&managedkafkapb.ListAclsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/managedkafka/apiv1/managedkafkapb#ListAclsRequest.}forresp,err:=rangec.ListAcls(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*Client) ListClusters
func(c*Client)ListClusters(ctxcontext.Context,req*managedkafkapb.ListClustersRequest,opts...gax.CallOption)*ClusterIteratorListClusters lists the clusters in a given project and location.
Examples
packagemainimport("context"managedkafka"cloud.google.com/go/managedkafka/apiv1"managedkafkapb"cloud.google.com/go/managedkafka/apiv1/managedkafkapb""google.golang.org/api/iterator")funcmain(){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_Optionsc,err:=managedkafka.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&managedkafkapb.ListClustersRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/managedkafka/apiv1/managedkafkapb#ListClustersRequest.}it:=c.ListClusters(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*managedkafkapb.ListClustersResponse)}}all
packagemainimport("context"managedkafka"cloud.google.com/go/managedkafka/apiv1"managedkafkapb"cloud.google.com/go/managedkafka/apiv1/managedkafkapb")funcmain(){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_Optionsc,err:=managedkafka.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&managedkafkapb.ListClustersRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/managedkafka/apiv1/managedkafkapb#ListClustersRequest.}forresp,err:=rangec.ListClusters(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*Client) ListConsumerGroups
func(c*Client)ListConsumerGroups(ctxcontext.Context,req*managedkafkapb.ListConsumerGroupsRequest,opts...gax.CallOption)*ConsumerGroupIteratorListConsumerGroups lists the consumer groups in a given cluster.
Examples
packagemainimport("context"managedkafka"cloud.google.com/go/managedkafka/apiv1"managedkafkapb"cloud.google.com/go/managedkafka/apiv1/managedkafkapb""google.golang.org/api/iterator")funcmain(){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_Optionsc,err:=managedkafka.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&managedkafkapb.ListConsumerGroupsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/managedkafka/apiv1/managedkafkapb#ListConsumerGroupsRequest.}it:=c.ListConsumerGroups(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*managedkafkapb.ListConsumerGroupsResponse)}}all
packagemainimport("context"managedkafka"cloud.google.com/go/managedkafka/apiv1"managedkafkapb"cloud.google.com/go/managedkafka/apiv1/managedkafkapb")funcmain(){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_Optionsc,err:=managedkafka.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&managedkafkapb.ListConsumerGroupsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/managedkafka/apiv1/managedkafkapb#ListConsumerGroupsRequest.}forresp,err:=rangec.ListConsumerGroups(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*Client) ListLocations
func(c*Client)ListLocations(ctxcontext.Context,req*locationpb.ListLocationsRequest,opts...gax.CallOption)*LocationIteratorListLocations lists information about the supported locations for this service.
Examples
packagemainimport("context"managedkafka"cloud.google.com/go/managedkafka/apiv1""google.golang.org/api/iterator"locationpb"google.golang.org/genproto/googleapis/cloud/location")funcmain(){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_Optionsc,err:=managedkafka.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&locationpb.ListLocationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.}it:=c.ListLocations(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*locationpb.ListLocationsResponse)}}all
packagemainimport("context"managedkafka"cloud.google.com/go/managedkafka/apiv1"locationpb"google.golang.org/genproto/googleapis/cloud/location")funcmain(){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_Optionsc,err:=managedkafka.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&locationpb.ListLocationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.}forresp,err:=rangec.ListLocations(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*Client) ListOperations
func(c*Client)ListOperations(ctxcontext.Context,req*longrunningpb.ListOperationsRequest,opts...gax.CallOption)*OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"managedkafka"cloud.google.com/go/managedkafka/apiv1""google.golang.org/api/iterator")funcmain(){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_Optionsc,err:=managedkafka.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.ListOperationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.}it:=c.ListOperations(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*longrunningpb.ListOperationsResponse)}}all
packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"managedkafka"cloud.google.com/go/managedkafka/apiv1")funcmain(){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_Optionsc,err:=managedkafka.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.ListOperationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.}forresp,err:=rangec.ListOperations(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*Client) ListTopics
func(c*Client)ListTopics(ctxcontext.Context,req*managedkafkapb.ListTopicsRequest,opts...gax.CallOption)*TopicIteratorListTopics lists the topics in a given cluster.
Examples
packagemainimport("context"managedkafka"cloud.google.com/go/managedkafka/apiv1"managedkafkapb"cloud.google.com/go/managedkafka/apiv1/managedkafkapb""google.golang.org/api/iterator")funcmain(){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_Optionsc,err:=managedkafka.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&managedkafkapb.ListTopicsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/managedkafka/apiv1/managedkafkapb#ListTopicsRequest.}it:=c.ListTopics(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*managedkafkapb.ListTopicsResponse)}}all
packagemainimport("context"managedkafka"cloud.google.com/go/managedkafka/apiv1"managedkafkapb"cloud.google.com/go/managedkafka/apiv1/managedkafkapb")funcmain(){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_Optionsc,err:=managedkafka.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&managedkafkapb.ListTopicsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/managedkafka/apiv1/managedkafkapb#ListTopicsRequest.}forresp,err:=rangec.ListTopics(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*Client) RemoveAclEntry
func(c*Client)RemoveAclEntry(ctxcontext.Context,req*managedkafkapb.RemoveAclEntryRequest,opts...gax.CallOption)(*managedkafkapb.RemoveAclEntryResponse,error)RemoveAclEntry incremental update: Removes an acl entry from an acl. Deletes the acl ifits acl entries become empty (i.e. if the removed entry was the last one inthe acl).
Example
packagemainimport("context"managedkafka"cloud.google.com/go/managedkafka/apiv1"managedkafkapb"cloud.google.com/go/managedkafka/apiv1/managedkafkapb")funcmain(){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_Optionsc,err:=managedkafka.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&managedkafkapb.RemoveAclEntryRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/managedkafka/apiv1/managedkafkapb#RemoveAclEntryRequest.}resp,err:=c.RemoveAclEntry(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*Client) UpdateAcl
func(c*Client)UpdateAcl(ctxcontext.Context,req*managedkafkapb.UpdateAclRequest,opts...gax.CallOption)(*managedkafkapb.Acl,error)UpdateAcl updates the properties of a single acl.
Example
packagemainimport("context"managedkafka"cloud.google.com/go/managedkafka/apiv1"managedkafkapb"cloud.google.com/go/managedkafka/apiv1/managedkafkapb")funcmain(){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_Optionsc,err:=managedkafka.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&managedkafkapb.UpdateAclRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/managedkafka/apiv1/managedkafkapb#UpdateAclRequest.}resp,err:=c.UpdateAcl(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*Client) UpdateCluster
func(c*Client)UpdateCluster(ctxcontext.Context,req*managedkafkapb.UpdateClusterRequest,opts...gax.CallOption)(*UpdateClusterOperation,error)UpdateCluster updates the properties of a single cluster.
Example
packagemainimport("context"managedkafka"cloud.google.com/go/managedkafka/apiv1"managedkafkapb"cloud.google.com/go/managedkafka/apiv1/managedkafkapb")funcmain(){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_Optionsc,err:=managedkafka.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&managedkafkapb.UpdateClusterRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/managedkafka/apiv1/managedkafkapb#UpdateClusterRequest.}op,err:=c.UpdateCluster(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*Client) UpdateClusterOperation
func(c*Client)UpdateClusterOperation(namestring)*UpdateClusterOperationUpdateClusterOperation returns a new UpdateClusterOperation from a given name.The name must be that of a previously created UpdateClusterOperation, possibly from a different process.
func (*Client) UpdateConsumerGroup
func(c*Client)UpdateConsumerGroup(ctxcontext.Context,req*managedkafkapb.UpdateConsumerGroupRequest,opts...gax.CallOption)(*managedkafkapb.ConsumerGroup,error)UpdateConsumerGroup updates the properties of a single consumer group.
Example
packagemainimport("context"managedkafka"cloud.google.com/go/managedkafka/apiv1"managedkafkapb"cloud.google.com/go/managedkafka/apiv1/managedkafkapb")funcmain(){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_Optionsc,err:=managedkafka.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&managedkafkapb.UpdateConsumerGroupRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/managedkafka/apiv1/managedkafkapb#UpdateConsumerGroupRequest.}resp,err:=c.UpdateConsumerGroup(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*Client) UpdateTopic
func(c*Client)UpdateTopic(ctxcontext.Context,req*managedkafkapb.UpdateTopicRequest,opts...gax.CallOption)(*managedkafkapb.Topic,error)UpdateTopic updates the properties of a single topic.
Example
packagemainimport("context"managedkafka"cloud.google.com/go/managedkafka/apiv1"managedkafkapb"cloud.google.com/go/managedkafka/apiv1/managedkafkapb")funcmain(){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_Optionsc,err:=managedkafka.NewClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&managedkafkapb.UpdateTopicRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/managedkafka/apiv1/managedkafkapb#UpdateTopicRequest.}resp,err:=c.UpdateTopic(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}ClusterIterator
typeClusterIteratorstruct{// 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.Responseinterface{}// 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.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*managedkafkapb.Cluster,nextPageTokenstring,errerror)// contains filtered or unexported fields}ClusterIterator manages a stream of *managedkafkapb.Cluster.
func (*ClusterIterator) All
func(it*ClusterIterator)All()iter.Seq2[*managedkafkapb.Cluster,error]All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.
func (*ClusterIterator) Next
func(it*ClusterIterator)Next()(*managedkafkapb.Cluster,error)Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.
func (*ClusterIterator) PageInfo
func(it*ClusterIterator)PageInfo()*iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
ConnectClusterIterator
typeConnectClusterIteratorstruct{// 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.Responseinterface{}// 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.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*managedkafkapb.ConnectCluster,nextPageTokenstring,errerror)// contains filtered or unexported fields}ConnectClusterIterator manages a stream of *managedkafkapb.ConnectCluster.
func (*ConnectClusterIterator) All
func(it*ConnectClusterIterator)All()iter.Seq2[*managedkafkapb.ConnectCluster,error]All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.
func (*ConnectClusterIterator) Next
func(it*ConnectClusterIterator)Next()(*managedkafkapb.ConnectCluster,error)Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.
func (*ConnectClusterIterator) PageInfo
func(it*ConnectClusterIterator)PageInfo()*iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
ConnectorIterator
typeConnectorIteratorstruct{// 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.Responseinterface{}// 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.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*managedkafkapb.Connector,nextPageTokenstring,errerror)// contains filtered or unexported fields}ConnectorIterator manages a stream of *managedkafkapb.Connector.
func (*ConnectorIterator) All
func(it*ConnectorIterator)All()iter.Seq2[*managedkafkapb.Connector,error]All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.
func (*ConnectorIterator) Next
func(it*ConnectorIterator)Next()(*managedkafkapb.Connector,error)Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.
func (*ConnectorIterator) PageInfo
func(it*ConnectorIterator)PageInfo()*iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
ConsumerGroupIterator
typeConsumerGroupIteratorstruct{// 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.Responseinterface{}// 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.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*managedkafkapb.ConsumerGroup,nextPageTokenstring,errerror)// contains filtered or unexported fields}ConsumerGroupIterator manages a stream of *managedkafkapb.ConsumerGroup.
func (*ConsumerGroupIterator) All
func(it*ConsumerGroupIterator)All()iter.Seq2[*managedkafkapb.ConsumerGroup,error]All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.
func (*ConsumerGroupIterator) Next
func(it*ConsumerGroupIterator)Next()(*managedkafkapb.ConsumerGroup,error)Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.
func (*ConsumerGroupIterator) PageInfo
func(it*ConsumerGroupIterator)PageInfo()*iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
CreateClusterOperation
typeCreateClusterOperationstruct{// contains filtered or unexported fields}CreateClusterOperation manages a long-running operation from CreateCluster.
func (*CreateClusterOperation) Done
func(op*CreateClusterOperation)Done()boolDone reports whether the long-running operation has completed.
func (*CreateClusterOperation) Metadata
func(op*CreateClusterOperation)Metadata()(*managedkafkapb.OperationMetadata,error)Metadata returns metadata associated with the long-running operation.Metadata itself does not contact the server, but Poll does.To get the latest metadata, call this method after a successful call to Poll.If the metadata is not available, the returned metadata and error are both nil.
func (*CreateClusterOperation) Name
func(op*CreateClusterOperation)Name()stringName returns the name of the long-running operation.The name is assigned by the server and is unique within the service from which the operation is created.
func (*CreateClusterOperation) Poll
func(op*CreateClusterOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*managedkafkapb.Cluster,error)Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds andthe operation has completed with failure, the error is returned and op.Done will return true.If Poll succeeds and the operation has completed successfully,op.Done will return true, and the response of the operation is returned.If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*CreateClusterOperation) Wait
func(op*CreateClusterOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*managedkafkapb.Cluster,error)Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
CreateConnectClusterOperation
typeCreateConnectClusterOperationstruct{// contains filtered or unexported fields}CreateConnectClusterOperation manages a long-running operation from CreateConnectCluster.
func (*CreateConnectClusterOperation) Done
func(op*CreateConnectClusterOperation)Done()boolDone reports whether the long-running operation has completed.
func (*CreateConnectClusterOperation) Metadata
func(op*CreateConnectClusterOperation)Metadata()(*managedkafkapb.OperationMetadata,error)Metadata returns metadata associated with the long-running operation.Metadata itself does not contact the server, but Poll does.To get the latest metadata, call this method after a successful call to Poll.If the metadata is not available, the returned metadata and error are both nil.
func (*CreateConnectClusterOperation) Name
func(op*CreateConnectClusterOperation)Name()stringName returns the name of the long-running operation.The name is assigned by the server and is unique within the service from which the operation is created.
func (*CreateConnectClusterOperation) Poll
func(op*CreateConnectClusterOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*managedkafkapb.ConnectCluster,error)Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds andthe operation has completed with failure, the error is returned and op.Done will return true.If Poll succeeds and the operation has completed successfully,op.Done will return true, and the response of the operation is returned.If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*CreateConnectClusterOperation) Wait
func(op*CreateConnectClusterOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*managedkafkapb.ConnectCluster,error)Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
DeleteClusterOperation
typeDeleteClusterOperationstruct{// contains filtered or unexported fields}DeleteClusterOperation manages a long-running operation from DeleteCluster.
func (*DeleteClusterOperation) Done
func(op*DeleteClusterOperation)Done()boolDone reports whether the long-running operation has completed.
func (*DeleteClusterOperation) Metadata
func(op*DeleteClusterOperation)Metadata()(*managedkafkapb.OperationMetadata,error)Metadata returns metadata associated with the long-running operation.Metadata itself does not contact the server, but Poll does.To get the latest metadata, call this method after a successful call to Poll.If the metadata is not available, the returned metadata and error are both nil.
func (*DeleteClusterOperation) Name
func(op*DeleteClusterOperation)Name()stringName returns the name of the long-running operation.The name is assigned by the server and is unique within the service from which the operation is created.
func (*DeleteClusterOperation) Poll
func(op*DeleteClusterOperation)Poll(ctxcontext.Context,opts...gax.CallOption)errorPoll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds andthe operation has completed with failure, the error is returned and op.Done will return true.If Poll succeeds and the operation has completed successfully,op.Done will return true, and the response of the operation is returned.If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*DeleteClusterOperation) Wait
func(op*DeleteClusterOperation)Wait(ctxcontext.Context,opts...gax.CallOption)errorWait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
DeleteConnectClusterOperation
typeDeleteConnectClusterOperationstruct{// contains filtered or unexported fields}DeleteConnectClusterOperation manages a long-running operation from DeleteConnectCluster.
func (*DeleteConnectClusterOperation) Done
func(op*DeleteConnectClusterOperation)Done()boolDone reports whether the long-running operation has completed.
func (*DeleteConnectClusterOperation) Metadata
func(op*DeleteConnectClusterOperation)Metadata()(*managedkafkapb.OperationMetadata,error)Metadata returns metadata associated with the long-running operation.Metadata itself does not contact the server, but Poll does.To get the latest metadata, call this method after a successful call to Poll.If the metadata is not available, the returned metadata and error are both nil.
func (*DeleteConnectClusterOperation) Name
func(op*DeleteConnectClusterOperation)Name()stringName returns the name of the long-running operation.The name is assigned by the server and is unique within the service from which the operation is created.
func (*DeleteConnectClusterOperation) Poll
func(op*DeleteConnectClusterOperation)Poll(ctxcontext.Context,opts...gax.CallOption)errorPoll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds andthe operation has completed with failure, the error is returned and op.Done will return true.If Poll succeeds and the operation has completed successfully,op.Done will return true, and the response of the operation is returned.If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*DeleteConnectClusterOperation) Wait
func(op*DeleteConnectClusterOperation)Wait(ctxcontext.Context,opts...gax.CallOption)errorWait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
LocationIterator
typeLocationIteratorstruct{// 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.Responseinterface{}// 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.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*locationpb.Location,nextPageTokenstring,errerror)// contains filtered or unexported fields}LocationIterator manages a stream of *locationpb.Location.
func (*LocationIterator) All
func(it*LocationIterator)All()iter.Seq2[*locationpb.Location,error]All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.
func (*LocationIterator) Next
func(it*LocationIterator)Next()(*locationpb.Location,error)Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.
func (*LocationIterator) PageInfo
func(it*LocationIterator)PageInfo()*iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
ManagedKafkaConnectCallOptions
typeManagedKafkaConnectCallOptionsstruct{ListConnectClusters[]gax.CallOptionGetConnectCluster[]gax.CallOptionCreateConnectCluster[]gax.CallOptionUpdateConnectCluster[]gax.CallOptionDeleteConnectCluster[]gax.CallOptionListConnectors[]gax.CallOptionGetConnector[]gax.CallOptionCreateConnector[]gax.CallOptionUpdateConnector[]gax.CallOptionDeleteConnector[]gax.CallOptionPauseConnector[]gax.CallOptionResumeConnector[]gax.CallOptionRestartConnector[]gax.CallOptionStopConnector[]gax.CallOptionGetLocation[]gax.CallOptionListLocations[]gax.CallOptionCancelOperation[]gax.CallOptionDeleteOperation[]gax.CallOptionGetOperation[]gax.CallOptionListOperations[]gax.CallOption}ManagedKafkaConnectCallOptions contains the retry settings for each method of ManagedKafkaConnectClient.
ManagedKafkaConnectClient
typeManagedKafkaConnectClientstruct{// The call options for this service.CallOptions*ManagedKafkaConnectCallOptions// LROClient is used internally to handle long-running operations.// It is exposed so that its CallOptions can be modified if required.// Users should not Close this client.LROClient*lroauto.OperationsClient// contains filtered or unexported fields}ManagedKafkaConnectClient is a client for interacting with Managed Service for Apache Kafka API.Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
The service that a client application uses to manage Apache Kafka Connectclusters and connectors.
func NewManagedKafkaConnectClient
funcNewManagedKafkaConnectClient(ctxcontext.Context,opts...option.ClientOption)(*ManagedKafkaConnectClient,error)NewManagedKafkaConnectClient creates a new managed kafka connect client based on gRPC.The returned client must be Closed when it is done being used to clean up its underlying connections.
The service that a client application uses to manage Apache Kafka Connectclusters and connectors.
Example
packagemainimport("context"managedkafka"cloud.google.com/go/managedkafka/apiv1")funcmain(){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_Optionsc,err:=managedkafka.NewManagedKafkaConnectClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func NewManagedKafkaConnectRESTClient
funcNewManagedKafkaConnectRESTClient(ctxcontext.Context,opts...option.ClientOption)(*ManagedKafkaConnectClient,error)NewManagedKafkaConnectRESTClient creates a new managed kafka connect rest client.
The service that a client application uses to manage Apache Kafka Connectclusters and connectors.
Example
packagemainimport("context"managedkafka"cloud.google.com/go/managedkafka/apiv1")funcmain(){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_Optionsc,err:=managedkafka.NewManagedKafkaConnectRESTClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()// TODO: Use client._=c}func (*ManagedKafkaConnectClient) CancelOperation
func(c*ManagedKafkaConnectClient)CancelOperation(ctxcontext.Context,req*longrunningpb.CancelOperationRequest,opts...gax.CallOption)errorCancelOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"managedkafka"cloud.google.com/go/managedkafka/apiv1")funcmain(){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_Optionsc,err:=managedkafka.NewManagedKafkaConnectClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.CancelOperationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#CancelOperationRequest.}err=c.CancelOperation(ctx,req)iferr!=nil{// TODO: Handle error.}}func (*ManagedKafkaConnectClient) Close
func(c*ManagedKafkaConnectClient)Close()errorClose closes the connection to the API service. The user should invoke this whenthe client is no longer required.
func (*ManagedKafkaConnectClient) Connection (deprecated)
func(c*ManagedKafkaConnectClient)Connection()*grpc.ClientConnConnection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.
func (*ManagedKafkaConnectClient) CreateConnectCluster
func(c*ManagedKafkaConnectClient)CreateConnectCluster(ctxcontext.Context,req*managedkafkapb.CreateConnectClusterRequest,opts...gax.CallOption)(*CreateConnectClusterOperation,error)CreateConnectCluster creates a new Kafka Connect cluster in a given project and location.
Example
packagemainimport("context"managedkafka"cloud.google.com/go/managedkafka/apiv1"managedkafkapb"cloud.google.com/go/managedkafka/apiv1/managedkafkapb")funcmain(){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_Optionsc,err:=managedkafka.NewManagedKafkaConnectClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&managedkafkapb.CreateConnectClusterRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/managedkafka/apiv1/managedkafkapb#CreateConnectClusterRequest.}op,err:=c.CreateConnectCluster(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*ManagedKafkaConnectClient) CreateConnectClusterOperation
func(c*ManagedKafkaConnectClient)CreateConnectClusterOperation(namestring)*CreateConnectClusterOperationCreateConnectClusterOperation returns a new CreateConnectClusterOperation from a given name.The name must be that of a previously created CreateConnectClusterOperation, possibly from a different process.
func (*ManagedKafkaConnectClient) CreateConnector
func(c*ManagedKafkaConnectClient)CreateConnector(ctxcontext.Context,req*managedkafkapb.CreateConnectorRequest,opts...gax.CallOption)(*managedkafkapb.Connector,error)CreateConnector creates a new connector in a given Connect cluster.
Example
packagemainimport("context"managedkafka"cloud.google.com/go/managedkafka/apiv1"managedkafkapb"cloud.google.com/go/managedkafka/apiv1/managedkafkapb")funcmain(){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_Optionsc,err:=managedkafka.NewManagedKafkaConnectClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&managedkafkapb.CreateConnectorRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/managedkafka/apiv1/managedkafkapb#CreateConnectorRequest.}resp,err:=c.CreateConnector(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*ManagedKafkaConnectClient) DeleteConnectCluster
func(c*ManagedKafkaConnectClient)DeleteConnectCluster(ctxcontext.Context,req*managedkafkapb.DeleteConnectClusterRequest,opts...gax.CallOption)(*DeleteConnectClusterOperation,error)DeleteConnectCluster deletes a single Connect cluster.
Example
packagemainimport("context"managedkafka"cloud.google.com/go/managedkafka/apiv1"managedkafkapb"cloud.google.com/go/managedkafka/apiv1/managedkafkapb")funcmain(){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_Optionsc,err:=managedkafka.NewManagedKafkaConnectClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&managedkafkapb.DeleteConnectClusterRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/managedkafka/apiv1/managedkafkapb#DeleteConnectClusterRequest.}op,err:=c.DeleteConnectCluster(ctx,req)iferr!=nil{// TODO: Handle error.}err=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}}func (*ManagedKafkaConnectClient) DeleteConnectClusterOperation
func(c*ManagedKafkaConnectClient)DeleteConnectClusterOperation(namestring)*DeleteConnectClusterOperationDeleteConnectClusterOperation returns a new DeleteConnectClusterOperation from a given name.The name must be that of a previously created DeleteConnectClusterOperation, possibly from a different process.
func (*ManagedKafkaConnectClient) DeleteConnector
func(c*ManagedKafkaConnectClient)DeleteConnector(ctxcontext.Context,req*managedkafkapb.DeleteConnectorRequest,opts...gax.CallOption)errorDeleteConnector deletes a connector.
Example
packagemainimport("context"managedkafka"cloud.google.com/go/managedkafka/apiv1"managedkafkapb"cloud.google.com/go/managedkafka/apiv1/managedkafkapb")funcmain(){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_Optionsc,err:=managedkafka.NewManagedKafkaConnectClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&managedkafkapb.DeleteConnectorRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/managedkafka/apiv1/managedkafkapb#DeleteConnectorRequest.}err=c.DeleteConnector(ctx,req)iferr!=nil{// TODO: Handle error.}}func (*ManagedKafkaConnectClient) DeleteOperation
func(c*ManagedKafkaConnectClient)DeleteOperation(ctxcontext.Context,req*longrunningpb.DeleteOperationRequest,opts...gax.CallOption)errorDeleteOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"managedkafka"cloud.google.com/go/managedkafka/apiv1")funcmain(){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_Optionsc,err:=managedkafka.NewManagedKafkaConnectClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.DeleteOperationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#DeleteOperationRequest.}err=c.DeleteOperation(ctx,req)iferr!=nil{// TODO: Handle error.}}func (*ManagedKafkaConnectClient) GetConnectCluster
func(c*ManagedKafkaConnectClient)GetConnectCluster(ctxcontext.Context,req*managedkafkapb.GetConnectClusterRequest,opts...gax.CallOption)(*managedkafkapb.ConnectCluster,error)GetConnectCluster returns the properties of a single Kafka Connect cluster.
Example
packagemainimport("context"managedkafka"cloud.google.com/go/managedkafka/apiv1"managedkafkapb"cloud.google.com/go/managedkafka/apiv1/managedkafkapb")funcmain(){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_Optionsc,err:=managedkafka.NewManagedKafkaConnectClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&managedkafkapb.GetConnectClusterRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/managedkafka/apiv1/managedkafkapb#GetConnectClusterRequest.}resp,err:=c.GetConnectCluster(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*ManagedKafkaConnectClient) GetConnector
func(c*ManagedKafkaConnectClient)GetConnector(ctxcontext.Context,req*managedkafkapb.GetConnectorRequest,opts...gax.CallOption)(*managedkafkapb.Connector,error)GetConnector returns the properties of a single connector.
Example
packagemainimport("context"managedkafka"cloud.google.com/go/managedkafka/apiv1"managedkafkapb"cloud.google.com/go/managedkafka/apiv1/managedkafkapb")funcmain(){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_Optionsc,err:=managedkafka.NewManagedKafkaConnectClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&managedkafkapb.GetConnectorRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/managedkafka/apiv1/managedkafkapb#GetConnectorRequest.}resp,err:=c.GetConnector(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*ManagedKafkaConnectClient) GetLocation
func(c*ManagedKafkaConnectClient)GetLocation(ctxcontext.Context,req*locationpb.GetLocationRequest,opts...gax.CallOption)(*locationpb.Location,error)GetLocation gets information about a location.
Example
packagemainimport("context"managedkafka"cloud.google.com/go/managedkafka/apiv1"locationpb"google.golang.org/genproto/googleapis/cloud/location")funcmain(){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_Optionsc,err:=managedkafka.NewManagedKafkaConnectClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&locationpb.GetLocationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#GetLocationRequest.}resp,err:=c.GetLocation(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*ManagedKafkaConnectClient) GetOperation
func(c*ManagedKafkaConnectClient)GetOperation(ctxcontext.Context,req*longrunningpb.GetOperationRequest,opts...gax.CallOption)(*longrunningpb.Operation,error)GetOperation is a utility method from google.longrunning.Operations.
Example
packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"managedkafka"cloud.google.com/go/managedkafka/apiv1")funcmain(){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_Optionsc,err:=managedkafka.NewManagedKafkaConnectClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.GetOperationRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#GetOperationRequest.}resp,err:=c.GetOperation(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*ManagedKafkaConnectClient) ListConnectClusters
func(c*ManagedKafkaConnectClient)ListConnectClusters(ctxcontext.Context,req*managedkafkapb.ListConnectClustersRequest,opts...gax.CallOption)*ConnectClusterIteratorListConnectClusters lists the Kafka Connect clusters in a given project and location.
Examples
packagemainimport("context"managedkafka"cloud.google.com/go/managedkafka/apiv1"managedkafkapb"cloud.google.com/go/managedkafka/apiv1/managedkafkapb""google.golang.org/api/iterator")funcmain(){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_Optionsc,err:=managedkafka.NewManagedKafkaConnectClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&managedkafkapb.ListConnectClustersRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/managedkafka/apiv1/managedkafkapb#ListConnectClustersRequest.}it:=c.ListConnectClusters(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*managedkafkapb.ListConnectClustersResponse)}}all
packagemainimport("context"managedkafka"cloud.google.com/go/managedkafka/apiv1"managedkafkapb"cloud.google.com/go/managedkafka/apiv1/managedkafkapb")funcmain(){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_Optionsc,err:=managedkafka.NewManagedKafkaConnectClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&managedkafkapb.ListConnectClustersRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/managedkafka/apiv1/managedkafkapb#ListConnectClustersRequest.}forresp,err:=rangec.ListConnectClusters(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*ManagedKafkaConnectClient) ListConnectors
func(c*ManagedKafkaConnectClient)ListConnectors(ctxcontext.Context,req*managedkafkapb.ListConnectorsRequest,opts...gax.CallOption)*ConnectorIteratorListConnectors lists the connectors in a given Connect cluster.
Examples
packagemainimport("context"managedkafka"cloud.google.com/go/managedkafka/apiv1"managedkafkapb"cloud.google.com/go/managedkafka/apiv1/managedkafkapb""google.golang.org/api/iterator")funcmain(){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_Optionsc,err:=managedkafka.NewManagedKafkaConnectClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&managedkafkapb.ListConnectorsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/managedkafka/apiv1/managedkafkapb#ListConnectorsRequest.}it:=c.ListConnectors(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*managedkafkapb.ListConnectorsResponse)}}all
packagemainimport("context"managedkafka"cloud.google.com/go/managedkafka/apiv1"managedkafkapb"cloud.google.com/go/managedkafka/apiv1/managedkafkapb")funcmain(){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_Optionsc,err:=managedkafka.NewManagedKafkaConnectClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&managedkafkapb.ListConnectorsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/managedkafka/apiv1/managedkafkapb#ListConnectorsRequest.}forresp,err:=rangec.ListConnectors(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*ManagedKafkaConnectClient) ListLocations
func(c*ManagedKafkaConnectClient)ListLocations(ctxcontext.Context,req*locationpb.ListLocationsRequest,opts...gax.CallOption)*LocationIteratorListLocations lists information about the supported locations for this service.
Examples
packagemainimport("context"managedkafka"cloud.google.com/go/managedkafka/apiv1""google.golang.org/api/iterator"locationpb"google.golang.org/genproto/googleapis/cloud/location")funcmain(){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_Optionsc,err:=managedkafka.NewManagedKafkaConnectClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&locationpb.ListLocationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.}it:=c.ListLocations(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*locationpb.ListLocationsResponse)}}all
packagemainimport("context"managedkafka"cloud.google.com/go/managedkafka/apiv1"locationpb"google.golang.org/genproto/googleapis/cloud/location")funcmain(){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_Optionsc,err:=managedkafka.NewManagedKafkaConnectClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&locationpb.ListLocationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest.}forresp,err:=rangec.ListLocations(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*ManagedKafkaConnectClient) ListOperations
func(c*ManagedKafkaConnectClient)ListOperations(ctxcontext.Context,req*longrunningpb.ListOperationsRequest,opts...gax.CallOption)*OperationIteratorListOperations is a utility method from google.longrunning.Operations.
Examples
packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"managedkafka"cloud.google.com/go/managedkafka/apiv1""google.golang.org/api/iterator")funcmain(){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_Optionsc,err:=managedkafka.NewManagedKafkaConnectClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.ListOperationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.}it:=c.ListOperations(ctx,req)for{resp,err:=it.Next()iferr==iterator.Done{break}iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp// If you need to access the underlying RPC response,// you can do so by casting the `Response` as below.// Otherwise, remove this line. Only populated after// first call to Next(). Not safe for concurrent access._=it.Response.(*longrunningpb.ListOperationsResponse)}}all
packagemainimport("context"longrunningpb"cloud.google.com/go/longrunning/autogen/longrunningpb"managedkafka"cloud.google.com/go/managedkafka/apiv1")funcmain(){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_Optionsc,err:=managedkafka.NewManagedKafkaConnectClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&longrunningpb.ListOperationsRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest.}forresp,err:=rangec.ListOperations(ctx,req).All(){iferr!=nil{// TODO: Handle error and break/return/continue. Iteration will stop after any error.}// TODO: Use resp._=resp}}func (*ManagedKafkaConnectClient) PauseConnector
func(c*ManagedKafkaConnectClient)PauseConnector(ctxcontext.Context,req*managedkafkapb.PauseConnectorRequest,opts...gax.CallOption)(*managedkafkapb.PauseConnectorResponse,error)PauseConnector pauses the connector and its tasks.
Example
packagemainimport("context"managedkafka"cloud.google.com/go/managedkafka/apiv1"managedkafkapb"cloud.google.com/go/managedkafka/apiv1/managedkafkapb")funcmain(){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_Optionsc,err:=managedkafka.NewManagedKafkaConnectClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&managedkafkapb.PauseConnectorRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/managedkafka/apiv1/managedkafkapb#PauseConnectorRequest.}resp,err:=c.PauseConnector(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*ManagedKafkaConnectClient) RestartConnector
func(c*ManagedKafkaConnectClient)RestartConnector(ctxcontext.Context,req*managedkafkapb.RestartConnectorRequest,opts...gax.CallOption)(*managedkafkapb.RestartConnectorResponse,error)RestartConnector restarts the connector.
Example
packagemainimport("context"managedkafka"cloud.google.com/go/managedkafka/apiv1"managedkafkapb"cloud.google.com/go/managedkafka/apiv1/managedkafkapb")funcmain(){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_Optionsc,err:=managedkafka.NewManagedKafkaConnectClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&managedkafkapb.RestartConnectorRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/managedkafka/apiv1/managedkafkapb#RestartConnectorRequest.}resp,err:=c.RestartConnector(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*ManagedKafkaConnectClient) ResumeConnector
func(c*ManagedKafkaConnectClient)ResumeConnector(ctxcontext.Context,req*managedkafkapb.ResumeConnectorRequest,opts...gax.CallOption)(*managedkafkapb.ResumeConnectorResponse,error)ResumeConnector resumes the connector and its tasks.
Example
packagemainimport("context"managedkafka"cloud.google.com/go/managedkafka/apiv1"managedkafkapb"cloud.google.com/go/managedkafka/apiv1/managedkafkapb")funcmain(){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_Optionsc,err:=managedkafka.NewManagedKafkaConnectClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&managedkafkapb.ResumeConnectorRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/managedkafka/apiv1/managedkafkapb#ResumeConnectorRequest.}resp,err:=c.ResumeConnector(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*ManagedKafkaConnectClient) StopConnector
func(c*ManagedKafkaConnectClient)StopConnector(ctxcontext.Context,req*managedkafkapb.StopConnectorRequest,opts...gax.CallOption)(*managedkafkapb.StopConnectorResponse,error)StopConnector stops the connector.
Example
packagemainimport("context"managedkafka"cloud.google.com/go/managedkafka/apiv1"managedkafkapb"cloud.google.com/go/managedkafka/apiv1/managedkafkapb")funcmain(){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_Optionsc,err:=managedkafka.NewManagedKafkaConnectClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&managedkafkapb.StopConnectorRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/managedkafka/apiv1/managedkafkapb#StopConnectorRequest.}resp,err:=c.StopConnector(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*ManagedKafkaConnectClient) UpdateConnectCluster
func(c*ManagedKafkaConnectClient)UpdateConnectCluster(ctxcontext.Context,req*managedkafkapb.UpdateConnectClusterRequest,opts...gax.CallOption)(*UpdateConnectClusterOperation,error)UpdateConnectCluster updates the properties of a single Kafka Connect cluster.
Example
packagemainimport("context"managedkafka"cloud.google.com/go/managedkafka/apiv1"managedkafkapb"cloud.google.com/go/managedkafka/apiv1/managedkafkapb")funcmain(){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_Optionsc,err:=managedkafka.NewManagedKafkaConnectClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&managedkafkapb.UpdateConnectClusterRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/managedkafka/apiv1/managedkafkapb#UpdateConnectClusterRequest.}op,err:=c.UpdateConnectCluster(ctx,req)iferr!=nil{// TODO: Handle error.}resp,err:=op.Wait(ctx)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}func (*ManagedKafkaConnectClient) UpdateConnectClusterOperation
func(c*ManagedKafkaConnectClient)UpdateConnectClusterOperation(namestring)*UpdateConnectClusterOperationUpdateConnectClusterOperation returns a new UpdateConnectClusterOperation from a given name.The name must be that of a previously created UpdateConnectClusterOperation, possibly from a different process.
func (*ManagedKafkaConnectClient) UpdateConnector
func(c*ManagedKafkaConnectClient)UpdateConnector(ctxcontext.Context,req*managedkafkapb.UpdateConnectorRequest,opts...gax.CallOption)(*managedkafkapb.Connector,error)UpdateConnector updates the properties of a connector.
Example
packagemainimport("context"managedkafka"cloud.google.com/go/managedkafka/apiv1"managedkafkapb"cloud.google.com/go/managedkafka/apiv1/managedkafkapb")funcmain(){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_Optionsc,err:=managedkafka.NewManagedKafkaConnectClient(ctx)iferr!=nil{// TODO: Handle error.}deferc.Close()req:=&managedkafkapb.UpdateConnectorRequest{// TODO: Fill request struct fields.// See https://pkg.go.dev/cloud.google.com/go/managedkafka/apiv1/managedkafkapb#UpdateConnectorRequest.}resp,err:=c.UpdateConnector(ctx,req)iferr!=nil{// TODO: Handle error.}// TODO: Use resp._=resp}OperationIterator
typeOperationIteratorstruct{// 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.Responseinterface{}// 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.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*longrunningpb.Operation,nextPageTokenstring,errerror)// contains filtered or unexported fields}OperationIterator manages a stream of *longrunningpb.Operation.
func (*OperationIterator) All
func(it*OperationIterator)All()iter.Seq2[*longrunningpb.Operation,error]All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.
func (*OperationIterator) Next
func(it*OperationIterator)Next()(*longrunningpb.Operation,error)Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.
func (*OperationIterator) PageInfo
func(it*OperationIterator)PageInfo()*iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
TopicIterator
typeTopicIteratorstruct{// 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.Responseinterface{}// 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.InternalFetchfunc(pageSizeint,pageTokenstring)(results[]*managedkafkapb.Topic,nextPageTokenstring,errerror)// contains filtered or unexported fields}TopicIterator manages a stream of *managedkafkapb.Topic.
func (*TopicIterator) All
func(it*TopicIterator)All()iter.Seq2[*managedkafkapb.Topic,error]All returns an iterator. If an error is returned by the iterator, theiterator will stop after that iteration.
func (*TopicIterator) Next
func(it*TopicIterator)Next()(*managedkafkapb.Topic,error)Next returns the next result. Its second return value is iterator.Done if there are no moreresults. Once Next returns Done, all subsequent calls will return Done.
func (*TopicIterator) PageInfo
func(it*TopicIterator)PageInfo()*iterator.PageInfoPageInfo supports pagination. See the [google.golang.org/api/iterator] package for details.
UpdateClusterOperation
typeUpdateClusterOperationstruct{// contains filtered or unexported fields}UpdateClusterOperation manages a long-running operation from UpdateCluster.
func (*UpdateClusterOperation) Done
func(op*UpdateClusterOperation)Done()boolDone reports whether the long-running operation has completed.
func (*UpdateClusterOperation) Metadata
func(op*UpdateClusterOperation)Metadata()(*managedkafkapb.OperationMetadata,error)Metadata returns metadata associated with the long-running operation.Metadata itself does not contact the server, but Poll does.To get the latest metadata, call this method after a successful call to Poll.If the metadata is not available, the returned metadata and error are both nil.
func (*UpdateClusterOperation) Name
func(op*UpdateClusterOperation)Name()stringName returns the name of the long-running operation.The name is assigned by the server and is unique within the service from which the operation is created.
func (*UpdateClusterOperation) Poll
func(op*UpdateClusterOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*managedkafkapb.Cluster,error)Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds andthe operation has completed with failure, the error is returned and op.Done will return true.If Poll succeeds and the operation has completed successfully,op.Done will return true, and the response of the operation is returned.If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*UpdateClusterOperation) Wait
func(op*UpdateClusterOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*managedkafkapb.Cluster,error)Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
UpdateConnectClusterOperation
typeUpdateConnectClusterOperationstruct{// contains filtered or unexported fields}UpdateConnectClusterOperation manages a long-running operation from UpdateConnectCluster.
func (*UpdateConnectClusterOperation) Done
func(op*UpdateConnectClusterOperation)Done()boolDone reports whether the long-running operation has completed.
func (*UpdateConnectClusterOperation) Metadata
func(op*UpdateConnectClusterOperation)Metadata()(*managedkafkapb.OperationMetadata,error)Metadata returns metadata associated with the long-running operation.Metadata itself does not contact the server, but Poll does.To get the latest metadata, call this method after a successful call to Poll.If the metadata is not available, the returned metadata and error are both nil.
func (*UpdateConnectClusterOperation) Name
func(op*UpdateConnectClusterOperation)Name()stringName returns the name of the long-running operation.The name is assigned by the server and is unique within the service from which the operation is created.
func (*UpdateConnectClusterOperation) Poll
func(op*UpdateConnectClusterOperation)Poll(ctxcontext.Context,opts...gax.CallOption)(*managedkafkapb.ConnectCluster,error)Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds andthe operation has completed with failure, the error is returned and op.Done will return true.If Poll succeeds and the operation has completed successfully,op.Done will return true, and the response of the operation is returned.If Poll succeeds and the operation has not completed, the returned response and error are both nil.
func (*UpdateConnectClusterOperation) Wait
func(op*UpdateConnectClusterOperation)Wait(ctxcontext.Context,opts...gax.CallOption)(*managedkafkapb.ConnectCluster,error)Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-10-30 UTC.