arq

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Feb 19, 2016 License: Apache-2.0 Imports: 23 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorCouldNotRecoverTree = errors.New("Couldn't find a tree in the Arq backup")
)
View Source
var (
	UUID_REGEXP = regexp.MustCompile("[a-zA-Z0-9-]{32,}")
)

Functions

func DownloadNode

func DownloadNode(node *arq_types.Node, cacheDirectory string, backupSet *ArqBackupSet,
	bucket *ArqBucket, sourcePath string, destinationPath string) error

func DownloadTree

func DownloadTree(tree *arq_types.Tree, cacheDirectory string, backupSet *ArqBackupSet,
	bucket *ArqBucket, sourcePath string, destinationPath string) error

func FindNode

func FindNode(cacheDirectory string, backupSet *ArqBackupSet, bucket *ArqBucket, targetPath string) (*arq_types.Tree, *arq_types.Node, error)

func GetDataBlobKeyContentsFromObjects

func GetDataBlobKeyContentsFromObjects(SHA1 [20]byte, bucket *ArqBucket) ([]byte, error)

func GetPathToBucketPackSetBlobs

func GetPathToBucketPackSetBlobs(abs *ArqBackupSet, ab *ArqBucket) string

func GetPathToBucketPackSetTrees

func GetPathToBucketPackSetTrees(abs *ArqBackupSet, ab *ArqBucket) string

func IsValidPackFile added in v0.1.4

func IsValidPackFile(cacheFilepath string) (bool, error)

* Verify that a pack file is valid. All pack files end with a 20-byte SHA1 of the full contents of the file.

Types

type ArqBackupSet

type ArqBackupSet struct {
	Connection      connector.Connection
	UUID            string
	ComputerInfo    *ArqComputerInfo
	Buckets         []*ArqBucket
	BlobDecrypter   *crypto.CryptoState
	BucketDecrypter *crypto.CryptoState
}

func GetArqBackupSets

func GetArqBackupSets(connection connector.Connection, password []byte) ([]*ArqBackupSet, error)

func NewArqBackupSet

func NewArqBackupSet(connection connector.Connection, password []byte, uuid string) (*ArqBackupSet, error)

func (*ArqBackupSet) CacheBlobPackSets

func (abs *ArqBackupSet) CacheBlobPackSets() error

func (*ArqBackupSet) CacheTreePackSets

func (abs *ArqBackupSet) CacheTreePackSets() error

func (ArqBackupSet) String

func (abs ArqBackupSet) String() string

type ArqBucket

type ArqBucket struct {
	Object       connector.Object
	UUID         string
	LocalPath    string
	ArqBackupSet *ArqBackupSet
	HeadSHA1     [20]byte
}

func NewArqBucket

func NewArqBucket(object connector.Object, abs *ArqBackupSet) (*ArqBucket, error)

func (ArqBucket) String

func (ab ArqBucket) String() string

type ArqComputerInfo

type ArqComputerInfo struct {
	UserName     string
	ComputerName string
}

func (ArqComputerInfo) String

func (aci ArqComputerInfo) String() string

type ArqPackSetIndex

type ArqPackSetIndex struct {
	CacheDirectory string
	ArqBackupSet   *ArqBackupSet
	ArqBucket      *ArqBucket
}

func NewPackSetIndex

func NewPackSetIndex(cacheDirectory string, abs *ArqBackupSet, ab *ArqBucket) (*ArqPackSetIndex, error)

func (*ArqPackSetIndex) GetBlobPackFile

func (apsi *ArqPackSetIndex) GetBlobPackFile(abs *ArqBackupSet, ab *ArqBucket, targetSHA1 [20]byte) ([]byte, error)

func (*ArqPackSetIndex) GetPackFileAsCommit

func (apsi *ArqPackSetIndex) GetPackFileAsCommit(backupSet *ArqBackupSet, bucket *ArqBucket, SHA1 [20]byte) (*arq_types.Commit, error)

func (*ArqPackSetIndex) GetPackFileAsTree

func (apsi *ArqPackSetIndex) GetPackFileAsTree(backupSet *ArqBackupSet, bucket *ArqBucket, SHA1 [20]byte) (*arq_types.Tree, error)

func (*ArqPackSetIndex) GetTreePackFile

func (apsi *ArqPackSetIndex) GetTreePackFile(abs *ArqBackupSet, ab *ArqBucket, targetSHA1 [20]byte) ([]byte, error)

TODO copy/paste of GetBlobPackFile, refactor

func (*ArqPackSetIndex) ListBlobIndexes

func (apsi *ArqPackSetIndex) ListBlobIndexes() ([]string, error)

func (*ArqPackSetIndex) ListTreeIndexes

func (apsi *ArqPackSetIndex) ListTreeIndexes() ([]string, error)

func (ArqPackSetIndex) String

func (apsi ArqPackSetIndex) String() string

type BlobKeysReader

type BlobKeysReader struct {
	// contains filtered or unexported fields
}

func (*BlobKeysReader) Read

func (r *BlobKeysReader) Read(p []byte) (int, error)

type PackFileObject

type PackFileObject struct {
	Mimetype *arq_types.String
	Name     *arq_types.String
	Data     *arq_types.String
}

func GetObjectFromBlobPackFile

func GetObjectFromBlobPackFile(abs *ArqBackupSet, ab *ArqBucket, pio *PackIndexObject, packName string) (*PackFileObject, error)

func GetObjectFromPackFile

func GetObjectFromPackFile(key string, abs *ArqBackupSet, ab *ArqBucket, pio *PackIndexObject, packName string) (*PackFileObject, error)

func GetObjectFromTreePackFile

func GetObjectFromTreePackFile(abs *ArqBackupSet, ab *ArqBucket, pio *PackIndexObject, packName string) (*PackFileObject, error)

func NewPackFileObject

func NewPackFileObject(buf []byte) (*PackFileObject, error)

type PackIndex

type PackIndex struct {
	Fanout [256]uint32
	// contains filtered or unexported fields
}

type PackIndexObject

type PackIndexObject struct {
	Offset uint64
	Length uint64
	SHA1   [20]byte
	// contains filtered or unexported fields
}

func (PackIndexObject) String

func (pio PackIndexObject) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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