file_restore

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(c HTTPClient) *Client

func (*Client) Download

func (c *Client) Download(ctx context.Context, req DownloadRequest) (interface{}, error)

Download Extract a file or directory (as zip archive) from a PBS backup.

func (*Client) List

func (c *Client) List(ctx context.Context, req ListRequest) ([]ListResponse, error)

List List files and directories for single file restore under the given path.

type DownloadRequest

type DownloadRequest struct {
	Filepath string `url:"filepath" json:"filepath"` // base64-path to the directory or file to download.
	Node     string `url:"node" json:"node"`         // The cluster node name.
	Storage  string `url:"storage" json:"storage"`   // The storage identifier.
	Volume   string `url:"volume" json:"volume"`     // Backup volume ID or name. Currently only PBS snapshots are supported.

}

type HTTPClient

type HTTPClient interface {
	Do(context.Context, string, string, interface{}, interface{}) error
}

type ListRequest

type ListRequest struct {
	Filepath string `url:"filepath" json:"filepath"` // base64-path to the directory or file being listed, or "/".
	Node     string `url:"node" json:"node"`         // The cluster node name.
	Storage  string `url:"storage" json:"storage"`   // The storage identifier.
	Volume   string `url:"volume" json:"volume"`     // Backup volume ID or name. Currently only PBS snapshots are supported.

}

type ListResponse

type ListResponse struct {
	Filepath string       `url:"filepath" json:"filepath"` // base64 path of the current entry
	Leaf     util.PVEBool `url:"leaf" json:"leaf"`         // If this entry is a leaf in the directory graph.
	Text     string       `url:"text" json:"text"`         // Entry display text.
	Type     string       `url:"type" json:"type"`         // Entry type.

	// The following parameters are optional
	Mtime *int `url:"mtime,omitempty" json:"mtime,omitempty"` // Entry last-modified time (unix timestamp).
	Size  *int `url:"size,omitempty" json:"size,omitempty"`   // Entry file size.
}

Jump to

Keyboard shortcuts

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