Package cloud.google.com/go/longrunning (v0.7.0) Stay organized with collections Save and categorize content based on your preferences.
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
typeOperationstruct{// contains filtered or unexported fields}Operation represents the result of an API call that may not be ready yet.
func InternalNewOperation
funcInternalNewOperation(inner*autogen.OperationsClient,proto*pb.Operation)*OperationInternalNewOperation 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 servermakes a best effort to cancel the operation, but success is notguaranteed. If the server doesn't support this method, it returnsstatus.Code(err) == codes.Unimplemented. Clients can usePoll or other methods to check whether the cancellation succeeded or whether theoperation completed despite cancellation. On successful cancellation,the operation is not deleted; instead, op.Poll returns an errorwith code Canceled.
func (*Operation) Delete
Delete deletes a long-running operation. This method indicates that the client isno longer interested in the operation result. It does not cancel theoperation. 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
func(op*Operation)Metadata(metaprotoadapt.MessageV1)errorMetadata 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 servicefrom which the operation is created.
func (*Operation) Poll
func(op*Operation)Poll(ctxcontext.Context,respprotoadapt.MessageV1,opts...gax.CallOption)errorPoll 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 operationis stored in resp.
func (*Operation) Wait
func(op*Operation)Wait(ctxcontext.Context,respprotoadapt.MessageV1,opts...gax.CallOption)errorWait is equivalent to WaitWithInterval using DefaultWaitInterval.
func (*Operation) WaitWithInterval
func(op*Operation)WaitWithInterval(ctxcontext.Context,respprotoadapt.MessageV1,intervaltime.Duration,opts...gax.CallOption)errorWaitWithInterval blocks until the operation is completed.If resp != nil, Wait stores the response in resp.WaitWithInterval polls every interval, except initiallywhen it polls using exponential backoff.
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.