Documentation ¶
Overview ¶
Package vpcaccess is an auto-generated package for the Serverless VPC Access API.
API for managing VPC access connectors.
General documentation ¶
For information that is relevant for all client libraries please reference https://pkg.go.dev/cloud.google.com/go#pkg-overview. Some information on this page includes:
- Authentication and Authorization
- Timeouts and Cancellation
- Testing against Client Libraries
- Debugging Client Libraries
- Inspecting errors
Example usage ¶
To get started with this package, create a client.
ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := vpcaccess.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close()
The client will use your default application credentials. Clients should be reused instead of created as needed. The methods of Client are safe for concurrent use by multiple goroutines. The returned client must be Closed when it is done being used.
Using the Client ¶
The following is an example of making an API call with the newly created client.
ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := vpcaccess.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &vpcaccesspb.CreateConnectorRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/vpcaccess/apiv1/vpcaccesspb#CreateConnectorRequest. } op, err := c.CreateConnector(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp
Use of Context ¶
The ctx passed to NewClient is used for authentication requests and for creating the underlying connection, but is not used for subsequent calls. Individual methods on the client use the ctx given to them.
To close the open connection, use the Close() method.
Index ¶
- func DefaultAuthScopes() []string
- type CallOptions
- type Client
- func (c *Client) Close() error
- func (c *Client) Connection() *grpc.ClientConndeprecated
- func (c *Client) CreateConnector(ctx context.Context, req *vpcaccesspb.CreateConnectorRequest, ...) (*CreateConnectorOperation, error)
- func (c *Client) CreateConnectorOperation(name string) *CreateConnectorOperation
- func (c *Client) DeleteConnector(ctx context.Context, req *vpcaccesspb.DeleteConnectorRequest, ...) (*DeleteConnectorOperation, error)
- func (c *Client) DeleteConnectorOperation(name string) *DeleteConnectorOperation
- func (c *Client) GetConnector(ctx context.Context, req *vpcaccesspb.GetConnectorRequest, ...) (*vpcaccesspb.Connector, error)
- func (c *Client) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, ...) (*longrunningpb.Operation, error)
- func (c *Client) ListConnectors(ctx context.Context, req *vpcaccesspb.ListConnectorsRequest, ...) *ConnectorIterator
- func (c *Client) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, ...) *LocationIterator
- func (c *Client) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, ...) *OperationIterator
- type ConnectorIterator
- type CreateConnectorOperation
- func (op *CreateConnectorOperation) Done() bool
- func (op *CreateConnectorOperation) Metadata() (*vpcaccesspb.OperationMetadata, error)
- func (op *CreateConnectorOperation) Name() string
- func (op *CreateConnectorOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*vpcaccesspb.Connector, error)
- func (op *CreateConnectorOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*vpcaccesspb.Connector, error)
- type DeleteConnectorOperation
- func (op *DeleteConnectorOperation) Done() bool
- func (op *DeleteConnectorOperation) Metadata() (*vpcaccesspb.OperationMetadata, error)
- func (op *DeleteConnectorOperation) Name() string
- func (op *DeleteConnectorOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
- func (op *DeleteConnectorOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
- type LocationIterator
- type OperationIterator
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultAuthScopes ¶
func DefaultAuthScopes() []string
DefaultAuthScopes reports the default set of authentication scopes to use with this package.
Types ¶
type CallOptions ¶
type CallOptions struct { CreateConnector []gax.CallOption GetConnector []gax.CallOption ListConnectors []gax.CallOption DeleteConnector []gax.CallOption ListLocations []gax.CallOption GetOperation []gax.CallOption ListOperations []gax.CallOption }
CallOptions contains the retry settings for each method of Client.
type Client ¶
type Client struct { // The call options for this service. CallOptions *CallOptions // 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 Serverless VPC Access API. Methods, except Close, may be called concurrently. However, fields must not be modified concurrently with method calls.
Serverless VPC Access API allows users to create and manage connectors for App Engine, Cloud Functions and Cloud Run to have internal connections to Virtual Private Cloud networks.
func NewClient ¶
NewClient creates a new vpc access service client based on gRPC. The returned client must be Closed when it is done being used to clean up its underlying connections.
Serverless VPC Access API allows users to create and manage connectors for App Engine, Cloud Functions and Cloud Run to have internal connections to Virtual Private Cloud networks.
Example ¶
package main import ( "context" vpcaccess "cloud.google.com/go/vpcaccess/apiv1" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := vpcaccess.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func NewRESTClient ¶ added in v1.6.0
NewRESTClient creates a new vpc access service rest client.
Serverless VPC Access API allows users to create and manage connectors for App Engine, Cloud Functions and Cloud Run to have internal connections to Virtual Private Cloud networks.
Example ¶
package main import ( "context" vpcaccess "cloud.google.com/go/vpcaccess/apiv1" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := vpcaccess.NewRESTClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() // TODO: Use client. _ = c }
Output:
func (*Client) Close ¶
Close closes the connection to the API service. The user should invoke this when the client is no longer required.
func (*Client) Connection
deprecated
func (c *Client) Connection() *grpc.ClientConn
Connection returns a connection to the API service.
Deprecated: Connections are now pooled so this method does not always return the same resource.
func (*Client) CreateConnector ¶
func (c *Client) CreateConnector(ctx context.Context, req *vpcaccesspb.CreateConnectorRequest, opts ...gax.CallOption) (*CreateConnectorOperation, error)
CreateConnector creates a Serverless VPC Access connector, returns an operation.
Example ¶
package main import ( "context" vpcaccess "cloud.google.com/go/vpcaccess/apiv1" vpcaccesspb "cloud.google.com/go/vpcaccess/apiv1/vpcaccesspb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := vpcaccess.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &vpcaccesspb.CreateConnectorRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/vpcaccess/apiv1/vpcaccesspb#CreateConnectorRequest. } op, err := c.CreateConnector(ctx, req) if err != nil { // TODO: Handle error. } resp, err := op.Wait(ctx) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) CreateConnectorOperation ¶
func (c *Client) CreateConnectorOperation(name string) *CreateConnectorOperation
CreateConnectorOperation returns a new CreateConnectorOperation from a given name. The name must be that of a previously created CreateConnectorOperation, possibly from a different process.
func (*Client) DeleteConnector ¶
func (c *Client) DeleteConnector(ctx context.Context, req *vpcaccesspb.DeleteConnectorRequest, opts ...gax.CallOption) (*DeleteConnectorOperation, error)
DeleteConnector deletes a Serverless VPC Access connector. Returns NOT_FOUND if the resource does not exist.
Example ¶
package main import ( "context" vpcaccess "cloud.google.com/go/vpcaccess/apiv1" vpcaccesspb "cloud.google.com/go/vpcaccess/apiv1/vpcaccesspb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := vpcaccess.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &vpcaccesspb.DeleteConnectorRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/vpcaccess/apiv1/vpcaccesspb#DeleteConnectorRequest. } op, err := c.DeleteConnector(ctx, req) if err != nil { // TODO: Handle error. } err = op.Wait(ctx) if err != nil { // TODO: Handle error. } }
Output:
func (*Client) DeleteConnectorOperation ¶
func (c *Client) DeleteConnectorOperation(name string) *DeleteConnectorOperation
DeleteConnectorOperation returns a new DeleteConnectorOperation from a given name. The name must be that of a previously created DeleteConnectorOperation, possibly from a different process.
func (*Client) GetConnector ¶
func (c *Client) GetConnector(ctx context.Context, req *vpcaccesspb.GetConnectorRequest, opts ...gax.CallOption) (*vpcaccesspb.Connector, error)
GetConnector gets a Serverless VPC Access connector. Returns NOT_FOUND if the resource does not exist.
Example ¶
package main import ( "context" vpcaccess "cloud.google.com/go/vpcaccess/apiv1" vpcaccesspb "cloud.google.com/go/vpcaccess/apiv1/vpcaccesspb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := vpcaccess.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &vpcaccesspb.GetConnectorRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/vpcaccess/apiv1/vpcaccesspb#GetConnectorRequest. } resp, err := c.GetConnector(ctx, req) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) GetOperation ¶ added in v1.3.0
func (c *Client) GetOperation(ctx context.Context, req *longrunningpb.GetOperationRequest, opts ...gax.CallOption) (*longrunningpb.Operation, error)
GetOperation is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" vpcaccess "cloud.google.com/go/vpcaccess/apiv1" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := vpcaccess.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.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) if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp }
Output:
func (*Client) ListConnectors ¶
func (c *Client) ListConnectors(ctx context.Context, req *vpcaccesspb.ListConnectorsRequest, opts ...gax.CallOption) *ConnectorIterator
ListConnectors lists Serverless VPC Access connectors.
Example ¶
package main import ( "context" vpcaccess "cloud.google.com/go/vpcaccess/apiv1" vpcaccesspb "cloud.google.com/go/vpcaccess/apiv1/vpcaccesspb" "google.golang.org/api/iterator" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := vpcaccess.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &vpcaccesspb.ListConnectorsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/vpcaccess/apiv1/vpcaccesspb#ListConnectorsRequest. } it := c.ListConnectors(ctx, req) for { resp, err := it.Next() if err == iterator.Done { break } if err != 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.(*vpcaccesspb.ListConnectorsResponse) } }
Output:
Example (All) ¶
package main import ( "context" vpcaccess "cloud.google.com/go/vpcaccess/apiv1" vpcaccesspb "cloud.google.com/go/vpcaccess/apiv1/vpcaccesspb" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := vpcaccess.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &vpcaccesspb.ListConnectorsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/vpcaccess/apiv1/vpcaccesspb#ListConnectorsRequest. } for resp, err := range c.ListConnectors(ctx, req).All() { if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*Client) ListLocations ¶ added in v1.3.0
func (c *Client) ListLocations(ctx context.Context, req *locationpb.ListLocationsRequest, opts ...gax.CallOption) *LocationIterator
ListLocations lists information about the supported locations for this service.
Example ¶
package main import ( "context" vpcaccess "cloud.google.com/go/vpcaccess/apiv1" "google.golang.org/api/iterator" locationpb "google.golang.org/genproto/googleapis/cloud/location" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := vpcaccess.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.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() if err == iterator.Done { break } if err != 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) } }
Output:
Example (All) ¶
package main import ( "context" vpcaccess "cloud.google.com/go/vpcaccess/apiv1" locationpb "google.golang.org/genproto/googleapis/cloud/location" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := vpcaccess.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &locationpb.ListLocationsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/google.golang.org/genproto/googleapis/cloud/location#ListLocationsRequest. } for resp, err := range c.ListLocations(ctx, req).All() { if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
func (*Client) ListOperations ¶ added in v1.3.0
func (c *Client) ListOperations(ctx context.Context, req *longrunningpb.ListOperationsRequest, opts ...gax.CallOption) *OperationIterator
ListOperations is a utility method from google.longrunning.Operations.
Example ¶
package main import ( "context" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" vpcaccess "cloud.google.com/go/vpcaccess/apiv1" "google.golang.org/api/iterator" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := vpcaccess.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.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() if err == iterator.Done { break } if err != 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) } }
Output:
Example (All) ¶
package main import ( "context" longrunningpb "cloud.google.com/go/longrunning/autogen/longrunningpb" vpcaccess "cloud.google.com/go/vpcaccess/apiv1" ) func main() { ctx := context.Background() // This snippet has been automatically generated and should be regarded as a code template only. // It will require modifications to work: // - It may require correct/in-range values for request initialization. // - It may require specifying regional endpoints when creating the service client as shown in: // https://pkg.go.dev/cloud.google.com/go#hdr-Client_Options c, err := vpcaccess.NewClient(ctx) if err != nil { // TODO: Handle error. } defer c.Close() req := &longrunningpb.ListOperationsRequest{ // TODO: Fill request struct fields. // See https://pkg.go.dev/cloud.google.com/go/longrunning/autogen/longrunningpb#ListOperationsRequest. } for resp, err := range c.ListOperations(ctx, req).All() { if err != nil { // TODO: Handle error. } // TODO: Use resp. _ = resp } }
Output:
type ConnectorIterator ¶
type ConnectorIterator struct { // Response is the raw response for the current page. // It must be cast to the RPC response type. // Calling Next() or InternalFetch() updates this value. Response interface{} // InternalFetch is for use by the Google Cloud Libraries only. // It is not part of the stable interface of this package. // // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. InternalFetch func(pageSize int, pageToken string) (results []*vpcaccesspb.Connector, nextPageToken string, err error) // contains filtered or unexported fields }
ConnectorIterator manages a stream of *vpcaccesspb.Connector.
func (*ConnectorIterator) All ¶ added in v1.8.1
func (it *ConnectorIterator) All() iter.Seq2[*vpcaccesspb.Connector, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*ConnectorIterator) Next ¶
func (it *ConnectorIterator) Next() (*vpcaccesspb.Connector, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*ConnectorIterator) PageInfo ¶
func (it *ConnectorIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type CreateConnectorOperation ¶
type CreateConnectorOperation struct {
// contains filtered or unexported fields
}
CreateConnectorOperation manages a long-running operation from CreateConnector.
func (*CreateConnectorOperation) Done ¶
func (op *CreateConnectorOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*CreateConnectorOperation) Metadata ¶
func (op *CreateConnectorOperation) Metadata() (*vpcaccesspb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*CreateConnectorOperation) Name ¶
func (op *CreateConnectorOperation) Name() string
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 (*CreateConnectorOperation) Poll ¶
func (op *CreateConnectorOperation) Poll(ctx context.Context, opts ...gax.CallOption) (*vpcaccesspb.Connector, error)
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the 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 (*CreateConnectorOperation) Wait ¶
func (op *CreateConnectorOperation) Wait(ctx context.Context, opts ...gax.CallOption) (*vpcaccesspb.Connector, error)
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type DeleteConnectorOperation ¶
type DeleteConnectorOperation struct {
// contains filtered or unexported fields
}
DeleteConnectorOperation manages a long-running operation from DeleteConnector.
func (*DeleteConnectorOperation) Done ¶
func (op *DeleteConnectorOperation) Done() bool
Done reports whether the long-running operation has completed.
func (*DeleteConnectorOperation) Metadata ¶
func (op *DeleteConnectorOperation) Metadata() (*vpcaccesspb.OperationMetadata, error)
Metadata returns metadata associated with the long-running operation. Metadata itself does not contact the server, but Poll does. To get the latest metadata, call this method after a successful call to Poll. If the metadata is not available, the returned metadata and error are both nil.
func (*DeleteConnectorOperation) Name ¶
func (op *DeleteConnectorOperation) Name() string
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 (*DeleteConnectorOperation) Poll ¶
func (op *DeleteConnectorOperation) Poll(ctx context.Context, opts ...gax.CallOption) error
Poll fetches the latest state of the long-running operation.
Poll also fetches the latest metadata, which can be retrieved by Metadata.
If Poll fails, the error is returned and op is unmodified. If Poll succeeds and the 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 (*DeleteConnectorOperation) Wait ¶
func (op *DeleteConnectorOperation) Wait(ctx context.Context, opts ...gax.CallOption) error
Wait blocks until the long-running operation is completed, returning the response and any errors encountered.
See documentation of Poll for error-handling information.
type LocationIterator ¶ added in v1.3.0
type LocationIterator struct { // Response is the raw response for the current page. // It must be cast to the RPC response type. // Calling Next() or InternalFetch() updates this value. Response interface{} // InternalFetch is for use by the Google Cloud Libraries only. // It is not part of the stable interface of this package. // // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. InternalFetch func(pageSize int, pageToken string) (results []*locationpb.Location, nextPageToken string, err error) // contains filtered or unexported fields }
LocationIterator manages a stream of *locationpb.Location.
func (*LocationIterator) All ¶ added in v1.8.1
func (it *LocationIterator) All() iter.Seq2[*locationpb.Location, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*LocationIterator) Next ¶ added in v1.3.0
func (it *LocationIterator) Next() (*locationpb.Location, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*LocationIterator) PageInfo ¶ added in v1.3.0
func (it *LocationIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.
type OperationIterator ¶ added in v1.3.0
type OperationIterator struct { // Response is the raw response for the current page. // It must be cast to the RPC response type. // Calling Next() or InternalFetch() updates this value. Response interface{} // InternalFetch is for use by the Google Cloud Libraries only. // It is not part of the stable interface of this package. // // InternalFetch returns results from a single call to the underlying RPC. // The number of results is no greater than pageSize. // If there are no more results, nextPageToken is empty and err is nil. InternalFetch func(pageSize int, pageToken string) (results []*longrunningpb.Operation, nextPageToken string, err error) // contains filtered or unexported fields }
OperationIterator manages a stream of *longrunningpb.Operation.
func (*OperationIterator) All ¶ added in v1.8.1
func (it *OperationIterator) All() iter.Seq2[*longrunningpb.Operation, error]
All returns an iterator. If an error is returned by the iterator, the iterator will stop after that iteration.
func (*OperationIterator) Next ¶ added in v1.3.0
func (it *OperationIterator) Next() (*longrunningpb.Operation, error)
Next returns the next result. Its second return value is iterator.Done if there are no more results. Once Next returns Done, all subsequent calls will return Done.
func (*OperationIterator) PageInfo ¶ added in v1.3.0
func (it *OperationIterator) PageInfo() *iterator.PageInfo
PageInfo supports pagination. See the google.golang.org/api/iterator package for details.