objectstore

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2018 License: Apache-2.0 Imports: 12 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, endpoint string, deltaOps DeltaBlockBackupOperations) (string, error)

func CreateSingleFileBackup

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

func DeleteDeltaBlockBackup

func DeleteDeltaBlockBackup(backupURL, endpoint string) error

func DeleteSingleFileBackup

func DeleteSingleFileBackup(backupURL, endpoint string) error

func GetBackupInfo

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

func List

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

func RegisterDriver

func RegisterDriver(kind string, initFunc InitFunc) error

func RestoreDeltaBlockBackup

func RestoreDeltaBlockBackup(backupURL, endpoint, volDevName string) error

func RestoreSingleFileBackup

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

Types

type Backup

type Backup struct {
	Name              string
	Driver            string
	VolumeName        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 {
	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, endpoint 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, endpoint string) (ObjectStoreDriver, error)

type Snapshot

type Snapshot struct {
	Name        string
	CreatedTime string
}

type Volume

type Volume struct {
	Name           string
	Driver         string
	Size           int64
	CreatedTime    string
	LastBackupName string
}

func LoadVolume

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

Jump to

Keyboard shortcuts

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