molecule

package
v0.0.0-...-2337eca Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2017 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Molecule

type Molecule struct {
	Id           string       `json:"id"`
	Path         string       `json:"path"`
	Hash         string       `json:"hash"`
	Atoms        []*atom.Atom `json:"-"`
	CreatedAt    time.Time    `json:"created_at"`
	OriginalSize int64        `json:"size"`
	// contains filtered or unexported fields
}

Container for storing backed up files. Handles splitting content between cubes.

func New

func New(path string, hash string, em *encrypt.EncryptionManager) (*Molecule, error)

Create a new molecule.

func (*Molecule) Close

func (m *Molecule) Close() error

Close the backup file.

func (*Molecule) Compress

func (m *Molecule) Compress() error

Compress file contents.

func (*Molecule) Encrypt

func (m *Molecule) Encrypt() error

Encrypt the file contents.

func (*Molecule) Header

func (m *Molecule) Header() ([]byte, error)

Serialize the molecule header.

func (*Molecule) Info

func (m *Molecule) Info() os.FileInfo

Get the current file info.

func (*Molecule) NewAtom

func (m *Molecule) NewAtom(cubeId string, size int64) *atom.Atom

Create a new atom instance.

func (*Molecule) Open

func (m *Molecule) Open() error

Open the file to be backed up.

func (*Molecule) OrigInfo

func (m *Molecule) OrigInfo() os.FileInfo

Get the original file info.

func (*Molecule) Read

func (m *Molecule) Read(p []byte) (n int, err error)

Read the file being backed up.

func (*Molecule) Seek

func (m *Molecule) Seek(offset int64, whence int) (int64, error)

Seek the backup file.

func (*Molecule) Size

func (m *Molecule) Size() int64

Get the remaining size to be read.

Jump to

Keyboard shortcuts

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