- 0.116.0 (latest)
- 0.115.1
- 0.114.0
- 0.113.0
- 0.112.2
- 0.111.0
- 0.110.10
- 0.109.0
- 0.108.0
- 0.107.0
- 0.106.0
- 0.105.0
- 0.104.0
- 0.103.0
- 0.102.1
- 0.101.1
- 0.100.2
- 0.99.0
- 0.98.0
- 0.97.0
- 0.96.0
- 0.95.0
- 0.94.1
- 0.93.3
- 0.92.3
- 0.91.1
- 0.90.0
- 0.89.0
- 0.88.0
- 0.87.0
- 0.86.0
- 0.85.0
- 0.84.0
- 0.83.0
- 0.82.0
- 0.81.0
- 0.80.0
- 0.79.0
- 0.78.0
- 0.77.0
- 0.76.0
- 0.75.0
Package longrunning supports Long Running Operations for the Google Cloud Libraries. See google.golang.org/genproto/googleapis/longrunning for its service definition.
Users of the Google Cloud Libraries will typically not use this package directly. Instead they will call functions returning Operations and call their methods.
This package is still experimental and subject to change.
Constants
DefaultWaitInterval
DefaultWaitInterval is the polling interval used by Operation.Wait.
Variables
ErrNoMetadata
ErrNoMetadata is the error returned by Metadata if the operation contains no metadata.
Operation
type Operation struct {
// contains filtered or unexported fields
}
Operation represents the result of an API call that may not be ready yet.
func InternalNewOperation
func InternalNewOperation(inner *autogen.OperationsClient, proto *pb.Operation) *Operation
InternalNewOperation is for use by the google Cloud Libraries only.
InternalNewOperation returns an long-running operation, abstracting the raw pb.Operation. The conn parameter refers to a server that proto was received from.
func (*Operation) Cancel
Cancel starts asynchronous cancellation on a long-running operation. The server makes a best effort to cancel the operation, but success is not guaranteed. If the server doesn't support this method, it returns status.Code(err) == codes.Unimplemented. Clients can use Poll or other methods to check whether the cancellation succeeded or whether the operation completed despite cancellation. On successful cancellation, the operation is not deleted; instead, op.Poll returns an error with code Canceled.
func (*Operation) Delete
Delete deletes a long-running operation. This method indicates that the client is no longer interested in the operation result. It does not cancel the operation. If the server doesn't support this method, status.Code(err) == codes.Unimplemented.
func (*Operation) Done
Done reports whether the long-running operation has completed.
func (*Operation) Metadata
Metadata unmarshals op's metadata into meta. If op does not contain any metadata, Metadata returns ErrNoMetadata and meta is unmodified.
func (*Operation) 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 (*Operation) Poll
Poll fetches the latest state of a long-running operation.
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; if resp != nil, the response of the operation is stored in resp.
func (*Operation) Wait
Wait is equivalent to WaitWithInterval using DefaultWaitInterval.
func (*Operation) WaitWithInterval
func (op *Operation) WaitWithInterval(ctx context.Context, resp proto.Message, interval time.Duration, opts ...gax.CallOption) error
WaitWithInterval blocks until the operation is completed. If resp != nil, Wait stores the response in resp. WaitWithInterval polls every interval, except initially when it polls using exponential backoff.
See documentation of Poll for error-handling information.