v1connect

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2024 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// AuthenticationLoginProcedure is the fully-qualified name of the Authentication's Login RPC.
	AuthenticationLoginProcedure = "/v1.Authentication/Login"
	// AuthenticationHashPasswordProcedure is the fully-qualified name of the Authentication's
	// HashPassword RPC.
	AuthenticationHashPasswordProcedure = "/v1.Authentication/HashPassword"
)

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 (
	// BackrestGetConfigProcedure is the fully-qualified name of the Backrest's GetConfig RPC.
	BackrestGetConfigProcedure = "/v1.Backrest/GetConfig"
	// BackrestSetConfigProcedure is the fully-qualified name of the Backrest's SetConfig RPC.
	BackrestSetConfigProcedure = "/v1.Backrest/SetConfig"
	// BackrestAddRepoProcedure is the fully-qualified name of the Backrest's AddRepo RPC.
	BackrestAddRepoProcedure = "/v1.Backrest/AddRepo"
	// BackrestGetOperationEventsProcedure is the fully-qualified name of the Backrest's
	// GetOperationEvents RPC.
	BackrestGetOperationEventsProcedure = "/v1.Backrest/GetOperationEvents"
	// BackrestGetOperationsProcedure is the fully-qualified name of the Backrest's GetOperations RPC.
	BackrestGetOperationsProcedure = "/v1.Backrest/GetOperations"
	// BackrestListSnapshotsProcedure is the fully-qualified name of the Backrest's ListSnapshots RPC.
	BackrestListSnapshotsProcedure = "/v1.Backrest/ListSnapshots"
	// BackrestListSnapshotFilesProcedure is the fully-qualified name of the Backrest's
	// ListSnapshotFiles RPC.
	BackrestListSnapshotFilesProcedure = "/v1.Backrest/ListSnapshotFiles"
	// BackrestBackupProcedure is the fully-qualified name of the Backrest's Backup RPC.
	BackrestBackupProcedure = "/v1.Backrest/Backup"
	// BackrestDoRepoTaskProcedure is the fully-qualified name of the Backrest's DoRepoTask RPC.
	BackrestDoRepoTaskProcedure = "/v1.Backrest/DoRepoTask"
	// BackrestForgetProcedure is the fully-qualified name of the Backrest's Forget RPC.
	BackrestForgetProcedure = "/v1.Backrest/Forget"
	// BackrestRestoreProcedure is the fully-qualified name of the Backrest's Restore RPC.
	BackrestRestoreProcedure = "/v1.Backrest/Restore"
	// BackrestCancelProcedure is the fully-qualified name of the Backrest's Cancel RPC.
	BackrestCancelProcedure = "/v1.Backrest/Cancel"
	// BackrestGetLogsProcedure is the fully-qualified name of the Backrest's GetLogs RPC.
	BackrestGetLogsProcedure = "/v1.Backrest/GetLogs"
	// BackrestRunCommandProcedure is the fully-qualified name of the Backrest's RunCommand RPC.
	BackrestRunCommandProcedure = "/v1.Backrest/RunCommand"
	// BackrestGetDownloadURLProcedure is the fully-qualified name of the Backrest's GetDownloadURL RPC.
	BackrestGetDownloadURLProcedure = "/v1.Backrest/GetDownloadURL"
	// BackrestClearHistoryProcedure is the fully-qualified name of the Backrest's ClearHistory RPC.
	BackrestClearHistoryProcedure = "/v1.Backrest/ClearHistory"
	// BackrestPathAutocompleteProcedure is the fully-qualified name of the Backrest's PathAutocomplete
	// RPC.
	BackrestPathAutocompleteProcedure = "/v1.Backrest/PathAutocomplete"
)

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 (
	// AuthenticationName is the fully-qualified name of the Authentication service.
	AuthenticationName = "v1.Authentication"
)
View Source
const (
	// BackrestName is the fully-qualified name of the Backrest service.
	BackrestName = "v1.Backrest"
)
View Source
const (
	// HubGetInstancesProcedure is the fully-qualified name of the Hub's GetInstances RPC.
	HubGetInstancesProcedure = "/v1.Hub/GetInstances"
)

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 (
	// HubName is the fully-qualified name of the Hub service.
	HubName = "v1.Hub"
)

Variables

This section is empty.

Functions

func NewAuthenticationHandler added in v0.11.0

func NewAuthenticationHandler(svc AuthenticationHandler, opts ...connect.HandlerOption) (string, http.Handler)

NewAuthenticationHandler 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.

func NewBackrestHandler

func NewBackrestHandler(svc BackrestHandler, opts ...connect.HandlerOption) (string, http.Handler)

NewBackrestHandler 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.

func NewHubHandler added in v1.0.0

func NewHubHandler(svc HubHandler, opts ...connect.HandlerOption) (string, http.Handler)

NewHubHandler 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 AuthenticationClient added in v0.11.0

AuthenticationClient is a client for the v1.Authentication service.

func NewAuthenticationClient added in v0.11.0

func NewAuthenticationClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) AuthenticationClient

NewAuthenticationClient constructs a client for the v1.Authentication 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 AuthenticationHandler added in v0.11.0

AuthenticationHandler is an implementation of the v1.Authentication service.

type BackrestClient

type BackrestClient interface {
	GetConfig(context.Context, *connect.Request[emptypb.Empty]) (*connect.Response[v1.Config], error)
	SetConfig(context.Context, *connect.Request[v1.Config]) (*connect.Response[v1.Config], error)
	AddRepo(context.Context, *connect.Request[v1.Repo]) (*connect.Response[v1.Config], error)
	GetOperationEvents(context.Context, *connect.Request[emptypb.Empty]) (*connect.ServerStreamForClient[v1.OperationEvent], error)
	GetOperations(context.Context, *connect.Request[v1.GetOperationsRequest]) (*connect.Response[v1.OperationList], error)
	ListSnapshots(context.Context, *connect.Request[v1.ListSnapshotsRequest]) (*connect.Response[v1.ResticSnapshotList], error)
	ListSnapshotFiles(context.Context, *connect.Request[v1.ListSnapshotFilesRequest]) (*connect.Response[v1.ListSnapshotFilesResponse], error)
	// Backup schedules a backup operation. It accepts a plan id and returns empty if the task is enqueued.
	Backup(context.Context, *connect.Request[types.StringValue]) (*connect.Response[emptypb.Empty], error)
	// DoRepoTask schedules a repo task. It accepts a repo id and a task type and returns empty if the task is enqueued.
	DoRepoTask(context.Context, *connect.Request[v1.DoRepoTaskRequest]) (*connect.Response[emptypb.Empty], error)
	// Forget schedules a forget operation. It accepts a plan id and returns empty if the task is enqueued.
	Forget(context.Context, *connect.Request[v1.ForgetRequest]) (*connect.Response[emptypb.Empty], error)
	// Restore schedules a restore operation.
	Restore(context.Context, *connect.Request[v1.RestoreSnapshotRequest]) (*connect.Response[emptypb.Empty], error)
	// Cancel attempts to cancel a task with the given operation ID. Not guaranteed to succeed.
	Cancel(context.Context, *connect.Request[types.Int64Value]) (*connect.Response[emptypb.Empty], error)
	// GetLogs returns the keyed large data for the given operation.
	GetLogs(context.Context, *connect.Request[v1.LogDataRequest]) (*connect.ServerStreamForClient[types.BytesValue], error)
	// RunCommand executes a generic restic command on the repository.
	RunCommand(context.Context, *connect.Request[v1.RunCommandRequest]) (*connect.ServerStreamForClient[types.BytesValue], error)
	// GetDownloadURL returns a signed download URL given a forget operation ID.
	GetDownloadURL(context.Context, *connect.Request[types.Int64Value]) (*connect.Response[types.StringValue], error)
	// Clears the history of operations
	ClearHistory(context.Context, *connect.Request[v1.ClearHistoryRequest]) (*connect.Response[emptypb.Empty], error)
	// PathAutocomplete provides path autocompletion options for a given filesystem path.
	PathAutocomplete(context.Context, *connect.Request[types.StringValue]) (*connect.Response[types.StringList], error)
}

BackrestClient is a client for the v1.Backrest service.

func NewBackrestClient

func NewBackrestClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) BackrestClient

NewBackrestClient constructs a client for the v1.Backrest 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 BackrestHandler

type BackrestHandler interface {
	GetConfig(context.Context, *connect.Request[emptypb.Empty]) (*connect.Response[v1.Config], error)
	SetConfig(context.Context, *connect.Request[v1.Config]) (*connect.Response[v1.Config], error)
	AddRepo(context.Context, *connect.Request[v1.Repo]) (*connect.Response[v1.Config], error)
	GetOperationEvents(context.Context, *connect.Request[emptypb.Empty], *connect.ServerStream[v1.OperationEvent]) error
	GetOperations(context.Context, *connect.Request[v1.GetOperationsRequest]) (*connect.Response[v1.OperationList], error)
	ListSnapshots(context.Context, *connect.Request[v1.ListSnapshotsRequest]) (*connect.Response[v1.ResticSnapshotList], error)
	ListSnapshotFiles(context.Context, *connect.Request[v1.ListSnapshotFilesRequest]) (*connect.Response[v1.ListSnapshotFilesResponse], error)
	// Backup schedules a backup operation. It accepts a plan id and returns empty if the task is enqueued.
	Backup(context.Context, *connect.Request[types.StringValue]) (*connect.Response[emptypb.Empty], error)
	// DoRepoTask schedules a repo task. It accepts a repo id and a task type and returns empty if the task is enqueued.
	DoRepoTask(context.Context, *connect.Request[v1.DoRepoTaskRequest]) (*connect.Response[emptypb.Empty], error)
	// Forget schedules a forget operation. It accepts a plan id and returns empty if the task is enqueued.
	Forget(context.Context, *connect.Request[v1.ForgetRequest]) (*connect.Response[emptypb.Empty], error)
	// Restore schedules a restore operation.
	Restore(context.Context, *connect.Request[v1.RestoreSnapshotRequest]) (*connect.Response[emptypb.Empty], error)
	// Cancel attempts to cancel a task with the given operation ID. Not guaranteed to succeed.
	Cancel(context.Context, *connect.Request[types.Int64Value]) (*connect.Response[emptypb.Empty], error)
	// GetLogs returns the keyed large data for the given operation.
	GetLogs(context.Context, *connect.Request[v1.LogDataRequest], *connect.ServerStream[types.BytesValue]) error
	// RunCommand executes a generic restic command on the repository.
	RunCommand(context.Context, *connect.Request[v1.RunCommandRequest], *connect.ServerStream[types.BytesValue]) error
	// GetDownloadURL returns a signed download URL given a forget operation ID.
	GetDownloadURL(context.Context, *connect.Request[types.Int64Value]) (*connect.Response[types.StringValue], error)
	// Clears the history of operations
	ClearHistory(context.Context, *connect.Request[v1.ClearHistoryRequest]) (*connect.Response[emptypb.Empty], error)
	// PathAutocomplete provides path autocompletion options for a given filesystem path.
	PathAutocomplete(context.Context, *connect.Request[types.StringValue]) (*connect.Response[types.StringList], error)
}

BackrestHandler is an implementation of the v1.Backrest service.

type HubClient added in v1.0.0

type HubClient interface {
	// GetInstances returns a list of all instances
	GetInstances(context.Context, *connect.Request[emptypb.Empty]) (*connect.Response[v1.GetInstancesResponse], error)
}

HubClient is a client for the v1.Hub service.

func NewHubClient added in v1.0.0

func NewHubClient(httpClient connect.HTTPClient, baseURL string, opts ...connect.ClientOption) HubClient

NewHubClient constructs a client for the v1.Hub 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 HubHandler added in v1.0.0

type HubHandler interface {
	// GetInstances returns a list of all instances
	GetInstances(context.Context, *connect.Request[emptypb.Empty]) (*connect.Response[v1.GetInstancesResponse], error)
}

HubHandler is an implementation of the v1.Hub service.

type UnimplementedAuthenticationHandler added in v0.11.0

type UnimplementedAuthenticationHandler struct{}

UnimplementedAuthenticationHandler returns CodeUnimplemented from all methods.

func (UnimplementedAuthenticationHandler) HashPassword added in v0.11.0

func (UnimplementedAuthenticationHandler) Login added in v0.11.0

type UnimplementedBackrestHandler

type UnimplementedBackrestHandler struct{}

UnimplementedBackrestHandler returns CodeUnimplemented from all methods.

func (UnimplementedBackrestHandler) AddRepo

func (UnimplementedBackrestHandler) Cancel

func (UnimplementedBackrestHandler) DoRepoTask added in v1.1.0

func (UnimplementedBackrestHandler) Forget

func (UnimplementedBackrestHandler) GetConfig

func (UnimplementedBackrestHandler) GetDownloadURL added in v1.0.0

func (UnimplementedBackrestHandler) GetLogs added in v0.11.0

func (UnimplementedBackrestHandler) PathAutocomplete

func (UnimplementedBackrestHandler) RunCommand added in v1.0.0

func (UnimplementedBackrestHandler) SetConfig

type UnimplementedHubHandler added in v1.0.0

type UnimplementedHubHandler struct{}

UnimplementedHubHandler returns CodeUnimplemented from all methods.

func (UnimplementedHubHandler) GetInstances added in v1.0.0

Jump to

Keyboard shortcuts

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