blockstores

package
v0.1.4-rc1 Latest Latest
Warning

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

Go to latest
Published: May 6, 2015 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BLOCKSTORE_BASE        = "rancher-blockstore"
	BLOCKSTORE_CONFIG_FILE = "blockstore.cfg"
	VOLUME_DIRECTORY       = "volumes"
	VOLUME_CONFIG_FILE     = "volume.cfg"
	VOLUME_SEPARATE_LAYER1 = 2
	VOLUME_SEPARATE_LAYER2 = 4
	SNAPSHOTS_DIRECTORY    = "snapshots"
	SNAPSHOT_CONFIG_PREFIX = "snapshot_"
	BLOCKS_DIRECTORY       = "blocks"
	BLOCK_SEPARATE_LAYER1  = 2
	BLOCK_SEPARATE_LAYER2  = 4
	DEFAULT_BLOCK_SIZE     = 2097152
)

Variables

This section is empty.

Functions

func AddVolume

func AddVolume(root, id, volumeID, base string, size int64) error

func BackupSnapshot

func BackupSnapshot(root, snapshotID, volumeID, blockstoreID string, sDriver drivers.Driver) error

func Deregister

func Deregister(root, id string) error

func List added in v0.1.3

func List(root, blockstoreID, volumeID string) error

func Register

func Register(root, kind string, config map[string]string) (string, int64, error)

func RegisterDriver

func RegisterDriver(kind string, initFunc InitFunc) error

func RemoveSnapshot

func RemoveSnapshot(root, snapshotID, volumeID, blockstoreID string) error

func RemoveVolume

func RemoveVolume(root, id, volumeID string) error

func RestoreSnapshot

func RestoreSnapshot(root, srcSnapshotID, srcVolumeID, dstVolumeID, blockstoreID string, sDriver drivers.Driver) error

Types

type BlockMapping

type BlockMapping struct {
	Offset        int64
	BlockChecksum string
}

type BlockStore

type BlockStore struct {
	UUID      string
	Kind      string
	BlockSize int64
}

type BlockStoreDriver

type BlockStoreDriver interface {
	Kind() string
	FinalizeInit(configFile, id string) error
	FileExists(path, fileName string) bool
	FileSize(path, fileName string) int64
	MkDirAll(dirName string) error
	RemoveAll(name string) error
	Read(srcPath, srcFileName string, data []byte) error
	Write(data []byte, dstPath, dstFileName string) error
	List(path string) ([]string, error)
	CopyToPath(srcFileName string, path string) error
}

func GetBlockStoreDriver

func GetBlockStoreDriver(kind, configFile string, config map[string]string) (BlockStoreDriver, error)

type InitFunc

type InitFunc func(configFile string, config map[string]string) (BlockStoreDriver, error)

type SnapshotMap

type SnapshotMap struct {
	ID     string
	Blocks []BlockMapping
}

type Volume

type Volume struct {
	Size           int64
	Base           string
	LastSnapshotID string
}

Jump to

Keyboard shortcuts

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