archiver

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2018 License: BSD-2-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Scan

func Scan(dirs []string, filter pipe.SelectFunc, p *restic.Progress) (restic.Stat, error)

Scan traverses the dirs to collect restic.Stat information while emitting progress information with p.

func TestSnapshot

func TestSnapshot(t testing.TB, repo restic.Repository, path string, parent *restic.ID) *restic.Snapshot

TestSnapshot creates a new snapshot of path.

Types

type Archiver

type Archiver struct {
	Warn         func(dir string, fi os.FileInfo, err error)
	SelectFilter pipe.SelectFunc
	Excludes     []string

	WithAccessTime bool
	// contains filtered or unexported fields
}

Archiver is used to backup a set of directories.

func New

func New(repo restic.Repository) *Archiver

New returns a new archiver.

func (*Archiver) Save

func (arch *Archiver) Save(ctx context.Context, t restic.BlobType, data []byte, id restic.ID) error

Save stores a blob read from rd in the repository.

func (*Archiver) SaveFile

func (arch *Archiver) SaveFile(ctx context.Context, p *restic.Progress, node *restic.Node) (*restic.Node, error)

SaveFile stores the content of the file on the backend as a Blob by calling Save for each chunk.

func (*Archiver) SaveTreeJSON

func (arch *Archiver) SaveTreeJSON(ctx context.Context, tree *restic.Tree) (restic.ID, error)

SaveTreeJSON stores a tree in the repository.

func (*Archiver) Snapshot

func (arch *Archiver) Snapshot(ctx context.Context, p *restic.Progress, paths, tags []string, hostname string, parentID *restic.ID, time time.Time) (*restic.Snapshot, restic.ID, error)

Snapshot creates a snapshot of the given paths. If parentrestic.ID is set, this is used to compare the files to the ones archived at the time this snapshot was taken.

type Reader

type Reader struct {
	restic.Repository

	Tags     []string
	Hostname string
}

Reader allows saving a stream of data to the repository.

func (*Reader) Archive

func (r *Reader) Archive(ctx context.Context, name string, rd io.Reader, p *restic.Progress) (*restic.Snapshot, restic.ID, error)

Archive reads data from the reader and saves it to the repo.

Jump to

Keyboard shortcuts

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