v1connect

package
v0.17.2 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 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"
	// BackrestIndexSnapshotsProcedure is the fully-qualified name of the Backrest's IndexSnapshots RPC.
	BackrestIndexSnapshotsProcedure = "/v1.Backrest/IndexSnapshots"
	// BackrestBackupProcedure is the fully-qualified name of the Backrest's Backup RPC.
	BackrestBackupProcedure = "/v1.Backrest/Backup"
	// BackrestPruneProcedure is the fully-qualified name of the Backrest's Prune RPC.
	BackrestPruneProcedure = "/v1.Backrest/Prune"
	// 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"
	// BackrestUnlockProcedure is the fully-qualified name of the Backrest's Unlock RPC.
	BackrestUnlockProcedure = "/v1.Backrest/Unlock"
	// BackrestStatsProcedure is the fully-qualified name of the Backrest's Stats RPC.
	BackrestStatsProcedure = "/v1.Backrest/Stats"
	// 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"
	// 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"
)

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.

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)
	// IndexSnapshots triggers indexin. It accepts a repo id and returns empty if the task is enqueued.
	IndexSnapshots(context.Context, *connect.Request[types.StringValue]) (*connect.Response[emptypb.Empty], 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)
	// Prune schedules a prune operation. It accepts a plan id and returns empty if the task is enqueued.
	Prune(context.Context, *connect.Request[types.StringValue]) (*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)
	// Unlock synchronously attempts to unlock the repo. Will block if other operations are in progress.
	Unlock(context.Context, *connect.Request[types.StringValue]) (*connect.Response[emptypb.Empty], error)
	// Stats runs 'restic stats` on the repository and appends the results to the operations log.
	Stats(context.Context, *connect.Request[types.StringValue]) (*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)
	// GetBigOperationData returns the keyed large data for the given operation.
	GetLogs(context.Context, *connect.Request[v1.LogDataRequest]) (*connect.Response[types.BytesValue], 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)
	// IndexSnapshots triggers indexin. It accepts a repo id and returns empty if the task is enqueued.
	IndexSnapshots(context.Context, *connect.Request[types.StringValue]) (*connect.Response[emptypb.Empty], 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)
	// Prune schedules a prune operation. It accepts a plan id and returns empty if the task is enqueued.
	Prune(context.Context, *connect.Request[types.StringValue]) (*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)
	// Unlock synchronously attempts to unlock the repo. Will block if other operations are in progress.
	Unlock(context.Context, *connect.Request[types.StringValue]) (*connect.Response[emptypb.Empty], error)
	// Stats runs 'restic stats` on the repository and appends the results to the operations log.
	Stats(context.Context, *connect.Request[types.StringValue]) (*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)
	// GetBigOperationData returns the keyed large data for the given operation.
	GetLogs(context.Context, *connect.Request[v1.LogDataRequest]) (*connect.Response[types.BytesValue], 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 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) Forget

func (UnimplementedBackrestHandler) GetConfig

func (UnimplementedBackrestHandler) GetLogs added in v0.11.0

func (UnimplementedBackrestHandler) IndexSnapshots added in v0.9.0

func (UnimplementedBackrestHandler) PathAutocomplete

func (UnimplementedBackrestHandler) SetConfig

Jump to

Keyboard shortcuts

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