backup

package
v0.0.0-...-da9ee33 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2022 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultArchiver = ZIP

DefaultArchiver represents an Archiver that is used when no others have been specified. Default is the ZIP archiver.

Functions

func DirHash

func DirHash(path string) (string, error)

DirHash calculates an MD5 hash of an entire directory structure.

Types

type Archiver

type Archiver interface {
	DestFmt() string
	Archive(src, dest string) error
	Restore(src, dest string) error
}

Archiver represents type capable of archiving and restoring files.

var ZIP Archiver = (*zipper)(nil)

ZIP is an Archiver that zips and unzips files.

type Monitor

type Monitor struct {
	Paths       map[string]string
	Archiver    Archiver
	Destination string
}

Monitor checks paths and archives any that have changed.

func (*Monitor) Now

func (m *Monitor) Now() (int, error)

Now checks all directories in Paths with the latest hash. Archive will be called for any paths whose hashes do not match.

Directories

Path Synopsis
cmds

Jump to

Keyboard shortcuts

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