fslocal

package
v1.102.1-cluster Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2024 License: Apache-2.0 Imports: 11 Imported by: 3

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 local directory to work with.
	Dir string

	// MaxBytesPerSecond is the maximum bandwidth usage during backups or restores.
	MaxBytesPerSecond int
	// contains filtered or unexported fields
}

FS represents local filesystem.

Backups are made from local fs. Data is restored from backups to local fs.

func (*FS) DeletePath

func (fs *FS) DeletePath(path string) (uint64, error)

DeletePath deletes the given path from fs and returns the size for the deleted file.

The path must be in canonical form, e.g. it must have `/` directory separators

func (*FS) Init added in v1.29.5

func (fs *FS) Init() error

Init initializes fs.

The returned fs must be stopped when no long needed with MustStop call.

func (*FS) ListParts

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

ListParts returns all the parts for fs.

func (*FS) MustStop added in v1.44.0

func (fs *FS) MustStop()

MustStop stops fs.

func (*FS) NewReadCloser

func (fs *FS) NewReadCloser(p common.Part) (io.ReadCloser, error)

NewReadCloser returns io.ReadCloser for the given part p located in fs.

func (*FS) NewWriteCloser

func (fs *FS) NewWriteCloser(p common.Part) (io.WriteCloser, error)

NewWriteCloser returns io.WriteCloser for the given part p located in 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 user-readable representation for the fs.

Jump to

Keyboard shortcuts

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