v1alpha1connect

package
v0.1.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 9, 2024 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// UploadNewProcedure is the fully-qualified name of the Upload's New RPC.
	UploadNewProcedure = "/bucketeer.upload.v1alpha1.Upload/New"
	// UploadAbortProcedure is the fully-qualified name of the Upload's Abort RPC.
	UploadAbortProcedure = "/bucketeer.upload.v1alpha1.Upload/Abort"
	// UploadCompleteProcedure is the fully-qualified name of the Upload's Complete RPC.
	UploadCompleteProcedure = "/bucketeer.upload.v1alpha1.Upload/Complete"
	// UploadPollForCompletionProcedure is the fully-qualified name of the Upload's PollForCompletion
	// RPC.
	UploadPollForCompletionProcedure = "/bucketeer.upload.v1alpha1.Upload/PollForCompletion"
)

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.

View Source
const (
	// UploadName is the fully-qualified name of the Upload service.
	UploadName = "bucketeer.upload.v1alpha1.Upload"
)

Variables

This section is empty.

Functions

func NewUploadHandler

func NewUploadHandler(svc UploadHandler, opts ...connect.HandlerOption) (string, http.Handler)

NewUploadHandler 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 UnimplementedUploadHandler

type UnimplementedUploadHandler struct{}

UnimplementedUploadHandler returns CodeUnimplemented from all methods.

type UploadClient

type UploadClient interface {
	// New initiates a new upload and returns a unique identifier for the upload.
	New(context.Context, *connect.Request[v1alpha1.NewRequest]) (*connect.Response[wrapperspb.StringValue], error)
	// Abort aborts an upload and cleans up any resources associated with it.
	Abort(context.Context, *connect.Request[wrapperspb.StringValue]) (*connect.Response[emptypb.Empty], error)
	// Complete begins the process of completing an upload, data isn't guaranteed
	// to be flushed to disk until PollForCompletion() returns a status of
	// COMPLETED. We split this into two calls to allow for the possibility of a
	// long-running completion process (eg. transferring to remote storage).
	Complete(context.Context, *connect.Request[wrapperspb.StringValue]) (*connect.Response[emptypb.Empty], error)
	// PollForCompletion polls for the completion of an upload (eg. has it been
	// fully flushed to disk?)
	PollForCompletion(context.Context, *connect.Request[wrapperspb.StringValue]) (*connect.Response[v1alpha1.CompleteResponse], error)
}

UploadClient is a client for the bucketeer.upload.v1alpha1.Upload service.

func NewUploadClient

func NewUploadClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) UploadClient

NewUploadClient constructs a client for the bucketeer.upload.v1alpha1.Upload 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 UploadHandler

type UploadHandler interface {
	// New initiates a new upload and returns a unique identifier for the upload.
	New(context.Context, *connect.Request[v1alpha1.NewRequest]) (*connect.Response[wrapperspb.StringValue], error)
	// Abort aborts an upload and cleans up any resources associated with it.
	Abort(context.Context, *connect.Request[wrapperspb.StringValue]) (*connect.Response[emptypb.Empty], error)
	// Complete begins the process of completing an upload, data isn't guaranteed
	// to be flushed to disk until PollForCompletion() returns a status of
	// COMPLETED. We split this into two calls to allow for the possibility of a
	// long-running completion process (eg. transferring to remote storage).
	Complete(context.Context, *connect.Request[wrapperspb.StringValue]) (*connect.Response[emptypb.Empty], error)
	// PollForCompletion polls for the completion of an upload (eg. has it been
	// fully flushed to disk?)
	PollForCompletion(context.Context, *connect.Request[wrapperspb.StringValue]) (*connect.Response[v1alpha1.CompleteResponse], error)
}

UploadHandler is an implementation of the bucketeer.upload.v1alpha1.Upload service.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL