storage

package
v2.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package storage keep track of the uploaded backups.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuditFile

type AuditFile struct {
	Filename string
}

AuditFile stores all backup informations in a simple text file.

func NewAuditFile

func NewAuditFile(filename string) *AuditFile

NewAuditFile initializes a new AuditFile object.

func (*AuditFile) List

func (a *AuditFile) List() ([]cloud.Backup, error)

List all backup informations in the storage.

func (*AuditFile) Remove

func (a *AuditFile) Remove(id string) error

Remove a specific backup information from the storage.

func (*AuditFile) Save

func (a *AuditFile) Save(backup cloud.Backup) error

Save a backup information. It stores the backup information one per line with the following columns:

[datetime] [vaultName] [archiveID] [checksum]

type Storage

type Storage interface {
	// Save a backup information.
	Save(cloud.Backup) error

	// List all backup informations in the storage.
	List() ([]cloud.Backup, error)

	// Remove a specific backup information from the storage.
	Remove(id string) error
}

Storage represents all commands to manage backups information locally. After the backup is uploaded we must keep track of them locally to speed up recovery and cloud cleanup (remove old ones).

Jump to

Keyboard shortcuts

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