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 (
	// FilesystemReadDirProcedure is the fully-qualified name of the Filesystem's ReadDir RPC.
	FilesystemReadDirProcedure = "/bucketeer.filesystem.v1alpha1.Filesystem/ReadDir"
	// FilesystemStatProcedure is the fully-qualified name of the Filesystem's Stat RPC.
	FilesystemStatProcedure = "/bucketeer.filesystem.v1alpha1.Filesystem/Stat"
	// FilesystemMkdirAllProcedure is the fully-qualified name of the Filesystem's MkdirAll RPC.
	FilesystemMkdirAllProcedure = "/bucketeer.filesystem.v1alpha1.Filesystem/MkdirAll"
	// FilesystemRemoveAllProcedure is the fully-qualified name of the Filesystem's RemoveAll RPC.
	FilesystemRemoveAllProcedure = "/bucketeer.filesystem.v1alpha1.Filesystem/RemoveAll"
)

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 (
	// FilesystemName is the fully-qualified name of the Filesystem service.
	FilesystemName = "bucketeer.filesystem.v1alpha1.Filesystem"
)

Variables

This section is empty.

Functions

func NewFilesystemHandler

func NewFilesystemHandler(svc FilesystemHandler, opts ...connect.HandlerOption) (string, http.Handler)

NewFilesystemHandler 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 FilesystemClient

type FilesystemClient interface {
	// ReadDir returns a list of files in a directory.
	ReadDir(context.Context, *connect.Request[v1alpha1.ReadDirRequest]) (*connect.Response[v1alpha1.ReadDirResponse], error)
	// Stat returns information about a file or directory.
	Stat(context.Context, *connect.Request[wrapperspb.StringValue]) (*connect.Response[v1alpha1.FileInfo], error)
	// MkdirAll creates a directory and any necessary parents.
	MkdirAll(context.Context, *connect.Request[wrapperspb.StringValue]) (*connect.Response[emptypb.Empty], error)
	// RemoveAll removes a directory and any children it contains.
	RemoveAll(context.Context, *connect.Request[wrapperspb.StringValue]) (*connect.Response[emptypb.Empty], error)
}

FilesystemClient is a client for the bucketeer.filesystem.v1alpha1.Filesystem service.

func NewFilesystemClient

func NewFilesystemClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) FilesystemClient

NewFilesystemClient constructs a client for the bucketeer.filesystem.v1alpha1.Filesystem 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 FilesystemHandler

type FilesystemHandler interface {
	// ReadDir returns a list of files in a directory.
	ReadDir(context.Context, *connect.Request[v1alpha1.ReadDirRequest]) (*connect.Response[v1alpha1.ReadDirResponse], error)
	// Stat returns information about a file or directory.
	Stat(context.Context, *connect.Request[wrapperspb.StringValue]) (*connect.Response[v1alpha1.FileInfo], error)
	// MkdirAll creates a directory and any necessary parents.
	MkdirAll(context.Context, *connect.Request[wrapperspb.StringValue]) (*connect.Response[emptypb.Empty], error)
	// RemoveAll removes a directory and any children it contains.
	RemoveAll(context.Context, *connect.Request[wrapperspb.StringValue]) (*connect.Response[emptypb.Empty], error)
}

FilesystemHandler is an implementation of the bucketeer.filesystem.v1alpha1.Filesystem service.

type UnimplementedFilesystemHandler

type UnimplementedFilesystemHandler struct{}

UnimplementedFilesystemHandler returns CodeUnimplemented from all methods.

Jump to

Keyboard shortcuts

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