backup

package
v0.0.0-...-4ed1219 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2015 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultArchiver = ZIP

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