api

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2023 License: GPL-3.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ServeAPI

func ServeAPI(ctx context.Context, server *Server, mux *http.ServeMux) error

Handler returns an http.Handler serving the API, cancel the context to cleanly shut down the server.

Types

type Server

type Server struct {
	*v1.UnimplementedRestoraServer
	// contains filtered or unexported fields
}

func NewServer

func NewServer(config config.ConfigStore, orchestrator *orchestrator.Orchestrator, oplog *oplog.OpLog) *Server

func (*Server) AddRepo

func (s *Server) AddRepo(ctx context.Context, repo *v1.Repo) (*v1.Config, error)

AddRepo implements POST /v1/config/repo, it includes validation that the repo can be initialized.

func (*Server) Backup

func (s *Server) Backup(ctx context.Context, req *types.StringValue) (*emptypb.Empty, error)

func (*Server) Forget

func (s *Server) Forget(ctx context.Context, req *types.StringValue) (*emptypb.Empty, error)

func (*Server) GetConfig

func (s *Server) GetConfig(ctx context.Context, empty *emptypb.Empty) (*v1.Config, error)

GetConfig implements GET /v1/config

func (*Server) GetOperationEvents

func (s *Server) GetOperationEvents(_ *emptypb.Empty, stream v1.Restora_GetOperationEventsServer) error

GetOperationEvents implements GET /v1/events/operations

func (*Server) GetOperations

func (s *Server) GetOperations(ctx context.Context, req *v1.GetOperationsRequest) (*v1.OperationList, error)

func (*Server) ListSnapshotFiles

func (s *Server) ListSnapshotFiles(ctx context.Context, query *v1.ListSnapshotFilesRequest) (*v1.ListSnapshotFilesResponse, error)

func (*Server) ListSnapshots

func (s *Server) ListSnapshots(ctx context.Context, query *v1.ListSnapshotsRequest) (*v1.ResticSnapshotList, error)

ListSnapshots implements POST /v1/snapshots

func (*Server) PathAutocomplete

func (s *Server) PathAutocomplete(ctx context.Context, path *types.StringValue) (*types.StringList, error)

func (*Server) Prune

func (s *Server) Prune(ctx context.Context, req *types.StringValue) (*emptypb.Empty, error)

func (*Server) Restore

func (s *Server) Restore(ctx context.Context, req *v1.RestoreSnapshotRequest) (*emptypb.Empty, error)

func (*Server) SetConfig

func (s *Server) SetConfig(ctx context.Context, c *v1.Config) (*v1.Config, error)

SetConfig implements POST /v1/config

func (*Server) Unlock

func (s *Server) Unlock(ctx context.Context, req *types.StringValue) (*emptypb.Empty, error)

Jump to

Keyboard shortcuts

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