Managed Service for Apache Kafka API v1 - Package cloud.google.com/go/managedkafka/apiv1 (v0.8.1)

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:

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()[]string

DefaultAuthScopes 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

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.PageInfo

PageInfo 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

funcNewClient(ctxcontext.Context,opts...option.ClientOption)(*Client,error)

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

funcNewRESTClient(ctxcontext.Context,opts...option.ClientOption)(*Client,error)

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

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

CancelOperation 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

func(c*Client)Close()error

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.ClientConn

Connection returns a connection to the API service.

Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.

func (*Client) CreateAcl

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

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)*CreateClusterOperation

CreateClusterOperation 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

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

DeleteAcl 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

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)*DeleteClusterOperation

DeleteClusterOperation 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

DeleteConsumerGroup 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

DeleteOperation 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

DeleteTopic 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

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

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

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

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

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

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

ListAcls 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

ListClusters 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

ListConsumerGroups 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

ListLocations 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

ListOperations 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

ListTopics 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

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

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

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)*UpdateClusterOperation

UpdateClusterOperation 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

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

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

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.PageInfo

PageInfo 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

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.PageInfo

PageInfo 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

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.PageInfo

PageInfo 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

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.PageInfo

PageInfo 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

Done reports whether the long-running operation has completed.

func (*CreateClusterOperation) Metadata

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

Name 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

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

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

Done reports whether the long-running operation has completed.

func (*CreateConnectClusterOperation) Metadata

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

Name 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

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

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

Done reports whether the long-running operation has completed.

func (*DeleteClusterOperation) Metadata

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

Name 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

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 (*DeleteClusterOperation) Wait

Wait 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

Done reports whether the long-running operation has completed.

func (*DeleteConnectClusterOperation) Metadata

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

Name 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

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 (*DeleteConnectClusterOperation) Wait

Wait 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

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.PageInfo

PageInfo 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

CancelOperation 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

Close 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.ClientConn

Connection returns a connection to the API service.

Deprecated: Connections are now pooled so this method does not alwaysreturn the same resource.

func (*ManagedKafkaConnectClient) CreateConnectCluster

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)*CreateConnectClusterOperation

CreateConnectClusterOperation 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

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

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)*DeleteConnectClusterOperation

DeleteConnectClusterOperation 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

DeleteConnector 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

DeleteOperation 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

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

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

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

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

ListConnectClusters 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

ListConnectors 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

ListLocations 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

ListOperations 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

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

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

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

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

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)*UpdateConnectClusterOperation

UpdateConnectClusterOperation 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

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

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.PageInfo

PageInfo 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

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.PageInfo

PageInfo 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

Done reports whether the long-running operation has completed.

func (*UpdateClusterOperation) Metadata

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

Name 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

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

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

Done reports whether the long-running operation has completed.

func (*UpdateConnectClusterOperation) Metadata

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

Name 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

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

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.