fsremote

package
v1.87.6-cluster Latest Latest
Warning

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

Go to latest
Published: May 18, 2023 License: Apache-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FS

type FS struct {
	// Dir is a path to remote directory with backup data.
	Dir string
}

FS represents remote filesystem.

Backups are uploaded there. Data is downloaded from there during restore.

func (*FS) CopyPart

func (fs *FS) CopyPart(srcFS common.OriginFS, p common.Part) error

CopyPart copies the part p from srcFS to fs.

srcFS must have *FS type.

func (*FS) CreateFile added in v1.32.1

func (fs *FS) CreateFile(filePath string, data []byte) error

CreateFile creates filePath at fs and puts data into it.

The file is overwritten if it exists.

func (*FS) DeleteFile added in v1.32.1

func (fs *FS) DeleteFile(filePath string) error

DeleteFile deletes filePath at fs.

The function does nothing if the filePath doesn't exist.

func (*FS) DeletePart

func (fs *FS) DeletePart(p common.Part) error

DeletePart deletes the given part p from fs.

func (*FS) DownloadPart

func (fs *FS) DownloadPart(p common.Part, w io.Writer) error

DownloadPart download part p from fs to w.

func (*FS) HasFile added in v1.32.1

func (fs *FS) HasFile(filePath string) (bool, error)

HasFile returns true if filePath exists at fs.

func (*FS) ListParts

func (fs *FS) ListParts() ([]common.Part, error)

ListParts returns all the parts from fs.

func (*FS) MustStop added in v1.44.0

func (fs *FS) MustStop()

MustStop stops fs.

func (*FS) RemoveEmptyDirs

func (fs *FS) RemoveEmptyDirs() error

RemoveEmptyDirs recursively removes all the empty directories in fs.

func (*FS) String

func (fs *FS) String() string

String returns human-readable string representation for fs.

func (*FS) UploadPart

func (fs *FS) UploadPart(p common.Part, r io.Reader) error

UploadPart uploads p from r to fs.

Jump to

Keyboard shortcuts

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