files

package
v0.0.0-...-97c84cb Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileAccess

type FileAccess interface {
	ReadDir(name string) ([]os.DirEntry, error)
	Open(name string) (io.ReadCloser, error)
	Stat(name string) (os.FileInfo, error)
}

type TreeHashedFile

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

func (TreeHashedFile) Content

func (fh TreeHashedFile) Content() (io.ReadCloser, error)

func (TreeHashedFile) Equal

func (fh TreeHashedFile) Equal(other TreeHashedFile) bool

func (TreeHashedFile) Hash

func (fh TreeHashedFile) Hash() string

func (TreeHashedFile) Path

func (fh TreeHashedFile) Path() string

func (TreeHashedFile) Size

func (fh TreeHashedFile) Size() (int64, error)

func (TreeHashedFile) String

func (fh TreeHashedFile) String() string

type Volume

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

Volume is a backup source

func NewVolume

func NewVolume(basePath string, excludes ...string) Volume

NewVolume creates a volume for specified path. excludes define paths that should not be synchronized.

func (Volume) LoadFile

func (l Volume) LoadFile(subPath string) (_ TreeHashedFile, err error)

LoadFile loads specified file

func (Volume) LoadTree

func (l Volume) LoadTree() ([]model.FileWithContent, error)

LoadTree loads all files from the Volume

func (Volume) Save

func (l Volume) Save(content model.FileWithContent) (err error)

Save stores a file in volume

Jump to

Keyboard shortcuts

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