Documentation ¶
Index ¶
- Constants
- func NewOperationsHandler(svc OperationsHandler, opts ...connect_go.HandlerOption) (string, http.Handler)
- type OperationsClient
- type OperationsHandler
- type UnimplementedOperationsHandler
- func (UnimplementedOperationsHandler) CancelOperation(context.Context, *connect_go.Request[longrunning.CancelOperationRequest]) (*connect_go.Response[emptypb.Empty], error)
- func (UnimplementedOperationsHandler) DeleteOperation(context.Context, *connect_go.Request[longrunning.DeleteOperationRequest]) (*connect_go.Response[emptypb.Empty], error)
- func (UnimplementedOperationsHandler) GetOperation(context.Context, *connect_go.Request[longrunning.GetOperationRequest]) (*connect_go.Response[longrunning.Operation], error)
- func (UnimplementedOperationsHandler) ListOperations(context.Context, *connect_go.Request[longrunning.ListOperationsRequest]) (*connect_go.Response[longrunning.ListOperationsResponse], error)
- func (UnimplementedOperationsHandler) WaitOperation(context.Context, *connect_go.Request[longrunning.WaitOperationRequest]) (*connect_go.Response[longrunning.Operation], error)
Constants ¶
const ( // OperationsListOperationsProcedure is the fully-qualified name of the Operations's ListOperations // RPC. OperationsListOperationsProcedure = "/google.longrunning.Operations/ListOperations" // OperationsGetOperationProcedure is the fully-qualified name of the Operations's GetOperation RPC. OperationsGetOperationProcedure = "/google.longrunning.Operations/GetOperation" // OperationsDeleteOperationProcedure is the fully-qualified name of the Operations's // DeleteOperation RPC. OperationsDeleteOperationProcedure = "/google.longrunning.Operations/DeleteOperation" // OperationsCancelOperationProcedure is the fully-qualified name of the Operations's // CancelOperation RPC. OperationsCancelOperationProcedure = "/google.longrunning.Operations/CancelOperation" // OperationsWaitOperationProcedure is the fully-qualified name of the Operations's WaitOperation // RPC. OperationsWaitOperationProcedure = "/google.longrunning.Operations/WaitOperation" )
These constants are the fully-qualified names of the RPCs defined in this package. They're exposed at runtime as Spec.Procedure and as the final two segments of the HTTP route.
Note that these are different from the fully-qualified method names used by google.golang.org/protobuf/reflect/protoreflect. To convert from these constants to reflection-formatted method names, remove the leading slash and convert the remaining slash to a period.
const (
// OperationsName is the fully-qualified name of the Operations service.
OperationsName = "google.longrunning.Operations"
)
Variables ¶
This section is empty.
Functions ¶
func NewOperationsHandler ¶
func NewOperationsHandler(svc OperationsHandler, opts ...connect_go.HandlerOption) (string, http.Handler)
NewOperationsHandler builds an HTTP handler from the service implementation. It returns the path on which to mount the handler and the handler itself.
By default, handlers support the Connect, gRPC, and gRPC-Web protocols with the binary Protobuf and JSON codecs. They also support gzip compression.
Types ¶
type OperationsClient ¶
type OperationsClient interface { // Lists operations that match the specified filter in the request. If the // server doesn't support this method, it returns `UNIMPLEMENTED`. // // NOTE: the `name` binding allows API services to override the binding // to use different resource name schemes, such as `users/*/operations`. To // override the binding, API services can add a binding such as // `"/v1/{name=users/*}/operations"` to their service configuration. // For backwards compatibility, the default name includes the operations // collection id, however overriding users must ensure the name binding // is the parent resource, without the operations collection id. ListOperations(context.Context, *connect_go.Request[longrunning.ListOperationsRequest]) (*connect_go.Response[longrunning.ListOperationsResponse], error) // Gets the latest state of a long-running operation. Clients can use this // method to poll the operation result at intervals as recommended by the API // service. GetOperation(context.Context, *connect_go.Request[longrunning.GetOperationRequest]) (*connect_go.Response[longrunning.Operation], error) // 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, it returns // `google.rpc.Code.UNIMPLEMENTED`. DeleteOperation(context.Context, *connect_go.Request[longrunning.DeleteOperationRequest]) (*connect_go.Response[emptypb.Empty], error) // 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 // `google.rpc.Code.UNIMPLEMENTED`. Clients can use // [Operations.GetOperation][google.longrunning.Operations.GetOperation] 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, it becomes an operation with // an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, // corresponding to `Code.CANCELLED`. CancelOperation(context.Context, *connect_go.Request[longrunning.CancelOperationRequest]) (*connect_go.Response[emptypb.Empty], error) // Waits until the specified long-running operation is done or reaches at most // a specified timeout, returning the latest state. If the operation is // already done, the latest state is immediately returned. If the timeout // specified is greater than the default HTTP/RPC timeout, the HTTP/RPC // timeout is used. If the server does not support this method, it returns // `google.rpc.Code.UNIMPLEMENTED`. // Note that this method is on a best-effort basis. It may return the latest // state before the specified timeout (including immediately), meaning even an // immediate response is no guarantee that the operation is done. WaitOperation(context.Context, *connect_go.Request[longrunning.WaitOperationRequest]) (*connect_go.Response[longrunning.Operation], error) }
OperationsClient is a client for the google.longrunning.Operations service.
func NewOperationsClient ¶
func NewOperationsClient(httpClient connect_go.HTTPClient, baseURL string, opts ...connect_go.ClientOption) OperationsClient
NewOperationsClient constructs a client for the google.longrunning.Operations service. By default, it uses the Connect protocol with the binary Protobuf Codec, asks for gzipped responses, and sends uncompressed requests. To use the gRPC or gRPC-Web protocols, supply the connect.WithGRPC() or connect.WithGRPCWeb() options.
The URL supplied here should be the base URL for the Connect or gRPC server (for example, http://api.acme.com or https://acme.com/grpc).
type OperationsHandler ¶
type OperationsHandler interface { // Lists operations that match the specified filter in the request. If the // server doesn't support this method, it returns `UNIMPLEMENTED`. // // NOTE: the `name` binding allows API services to override the binding // to use different resource name schemes, such as `users/*/operations`. To // override the binding, API services can add a binding such as // `"/v1/{name=users/*}/operations"` to their service configuration. // For backwards compatibility, the default name includes the operations // collection id, however overriding users must ensure the name binding // is the parent resource, without the operations collection id. ListOperations(context.Context, *connect_go.Request[longrunning.ListOperationsRequest]) (*connect_go.Response[longrunning.ListOperationsResponse], error) // Gets the latest state of a long-running operation. Clients can use this // method to poll the operation result at intervals as recommended by the API // service. GetOperation(context.Context, *connect_go.Request[longrunning.GetOperationRequest]) (*connect_go.Response[longrunning.Operation], error) // 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, it returns // `google.rpc.Code.UNIMPLEMENTED`. DeleteOperation(context.Context, *connect_go.Request[longrunning.DeleteOperationRequest]) (*connect_go.Response[emptypb.Empty], error) // 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 // `google.rpc.Code.UNIMPLEMENTED`. Clients can use // [Operations.GetOperation][google.longrunning.Operations.GetOperation] 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, it becomes an operation with // an [Operation.error][google.longrunning.Operation.error] value with a [google.rpc.Status.code][google.rpc.Status.code] of 1, // corresponding to `Code.CANCELLED`. CancelOperation(context.Context, *connect_go.Request[longrunning.CancelOperationRequest]) (*connect_go.Response[emptypb.Empty], error) // Waits until the specified long-running operation is done or reaches at most // a specified timeout, returning the latest state. If the operation is // already done, the latest state is immediately returned. If the timeout // specified is greater than the default HTTP/RPC timeout, the HTTP/RPC // timeout is used. If the server does not support this method, it returns // `google.rpc.Code.UNIMPLEMENTED`. // Note that this method is on a best-effort basis. It may return the latest // state before the specified timeout (including immediately), meaning even an // immediate response is no guarantee that the operation is done. WaitOperation(context.Context, *connect_go.Request[longrunning.WaitOperationRequest]) (*connect_go.Response[longrunning.Operation], error) }
OperationsHandler is an implementation of the google.longrunning.Operations service.
type UnimplementedOperationsHandler ¶
type UnimplementedOperationsHandler struct{}
UnimplementedOperationsHandler returns CodeUnimplemented from all methods.
func (UnimplementedOperationsHandler) CancelOperation ¶
func (UnimplementedOperationsHandler) CancelOperation(context.Context, *connect_go.Request[longrunning.CancelOperationRequest]) (*connect_go.Response[emptypb.Empty], error)
func (UnimplementedOperationsHandler) DeleteOperation ¶
func (UnimplementedOperationsHandler) DeleteOperation(context.Context, *connect_go.Request[longrunning.DeleteOperationRequest]) (*connect_go.Response[emptypb.Empty], error)
func (UnimplementedOperationsHandler) GetOperation ¶
func (UnimplementedOperationsHandler) GetOperation(context.Context, *connect_go.Request[longrunning.GetOperationRequest]) (*connect_go.Response[longrunning.Operation], error)
func (UnimplementedOperationsHandler) ListOperations ¶
func (UnimplementedOperationsHandler) ListOperations(context.Context, *connect_go.Request[longrunning.ListOperationsRequest]) (*connect_go.Response[longrunning.ListOperationsResponse], error)
func (UnimplementedOperationsHandler) WaitOperation ¶
func (UnimplementedOperationsHandler) WaitOperation(context.Context, *connect_go.Request[longrunning.WaitOperationRequest]) (*connect_go.Response[longrunning.Operation], error)