objectstore

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Aug 20, 2015 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OBJECTSTORE_BASE       = "convoy-objectstore"
	VOLUME_SEPARATE_LAYER1 = 2
	VOLUME_SEPARATE_LAYER2 = 4

	VOLUME_DIRECTORY     = "volumes"
	VOLUME_CONFIG_FILE   = "volume.cfg"
	BACKUP_DIRECTORY     = "backups"
	BACKUP_CONFIG_PREFIX = "backup_"

	CFG_SUFFIX = ".cfg"
)
View Source
const (
	DEFAULT_BLOCK_SIZE = 2097152

	BLOCKS_DIRECTORY      = "blocks"
	BLOCK_SEPARATE_LAYER1 = 2
	BLOCK_SEPARATE_LAYER2 = 4
)
View Source
const (
	BACKUP_FILES_DIRECTORY = "BackupFiles"
)

Variables

This section is empty.

Functions

func CreateDeltaBlockBackup

func CreateDeltaBlockBackup(volume *Volume, snapshot *Snapshot, destURL string, sDriver convoydriver.ConvoyDriver) (string, error)

func CreateSingleFileBackup

func CreateSingleFileBackup(volume *Volume, snapshot *Snapshot, filePath, destURL string) (string, error)

func DeleteDeltaBlockBackup

func DeleteDeltaBlockBackup(backupURL string) error

func DeleteSingleFileBackup

func DeleteSingleFileBackup(backupURL string) error

func GetBackupInfo

func GetBackupInfo(backupURL string) (map[string]string, error)

func List

func List(volumeUUID, destURL, storageDriverName string) (map[string]map[string]string, error)

func RegisterDriver

func RegisterDriver(kind string, initFunc InitFunc) error

func RestoreDeltaBlockBackup

func RestoreDeltaBlockBackup(backupURL, volDevName string) error

func RestoreSingleFileBackup

func RestoreSingleFileBackup(backupURL, path string) (string, error)

Types

type Backup

type Backup struct {
	UUID              string
	Driver            string
	VolumeUUID        string
	SnapshotUUID      string
	SnapshotName      string
	SnapshotCreatedAt string
	CreatedTime       string

	Blocks     []BlockMapping `json:",omitempty"`
	SingleFile BackupFile     `json:",omitempty"`
}

type BackupFile

type BackupFile struct {
	FilePath string
}

type BlockMapping

type BlockMapping struct {
	Offset        int64
	BlockChecksum string
}

type DeltaBlockBackupOperations

type DeltaBlockBackupOperations interface {
	GetVolumeDevice(id string) (string, error)
	HasSnapshot(id, volumeID string) bool
	CompareSnapshot(id, compareID, volumeID string) (*metadata.Mappings, error)
	OpenSnapshot(id, volumeID string) error
	ReadSnapshot(id, volumeID string, start int64, data []byte) error
	CloseSnapshot(id, volumeID string) error
}

type InitFunc

type InitFunc func(destURL string) (ObjectStoreDriver, error)

type ObjectStoreDriver

type ObjectStoreDriver interface {
	Kind() string
	GetURL() string
	FileExists(filePath string) bool
	FileSize(filePath string) int64
	Remove(names ...string) error           // Bahavior like "rm -rf"
	Read(src string) (io.ReadCloser, error) // Caller needs to close
	Write(dst string, rs io.ReadSeeker) error
	List(path string) ([]string, error) // Behavior like "ls", not like "find"
	Upload(src, dst string) error
	Download(src, dst string) error
}

func GetObjectStoreDriver

func GetObjectStoreDriver(destURL string) (ObjectStoreDriver, error)

type Snapshot

type Snapshot struct {
	UUID        string
	Name        string
	CreatedTime string
}

type Volume

type Volume struct {
	UUID           string
	Name           string
	Driver         string
	Size           int64
	FileSystem     string
	CreatedTime    string
	LastBackupUUID string
}

func LoadVolume

func LoadVolume(backupURL string) (*Volume, error)

Jump to

Keyboard shortcuts

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