Documentation ¶
Index ¶
- Variables
- type BlockDevice
- type BlockDriver
- type CephDriver
- func (d CephDriver) CopyBlockDevice(volumeUUID string) (BlockDevice, error)
- func (d CephDriver) CreateBlockDevice(imagePath *string, size int) (BlockDevice, error)
- func (d CephDriver) DeleteBlockDevice(volumeUUID string) error
- func (d CephDriver) GetVolumeMapping() (map[string][]string, error)
- func (d CephDriver) MapVolumeToNode(volumeUUID string) (string, error)
- func (d CephDriver) UnmapVolumeFromNode(volumeUUID string) error
- type NoopDriver
- func (d *NoopDriver) CopyBlockDevice(string) (BlockDevice, error)
- func (d *NoopDriver) CreateBlockDevice(image *string, size int) (BlockDevice, error)
- func (d *NoopDriver) DeleteBlockDevice(string) error
- func (d *NoopDriver) GetVolumeMapping() (map[string][]string, error)
- func (d *NoopDriver) MapVolumeToNode(volumeUUID string) (string, error)
- func (d *NoopDriver) UnmapVolumeFromNode(volumeUUID string) error
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNoDevice is returned from a driver ErrNoDevice = errors.New("Not able to create device") )
Functions ¶
This section is empty.
Types ¶
type BlockDevice ¶
type BlockDevice struct {
ID string
}
BlockDevice contains information about a block devices.
type BlockDriver ¶
type BlockDriver interface { CreateBlockDevice(image *string, sizeGB int) (BlockDevice, error) DeleteBlockDevice(string) error MapVolumeToNode(volumeUUID string) (string, error) UnmapVolumeFromNode(volumeUUID string) error GetVolumeMapping() (map[string][]string, error) CopyBlockDevice(string) (BlockDevice, error) }
BlockDriver is the interface that all block drivers must implement.
type CephDriver ¶
type CephDriver struct { // ID is the cephx user ID to use ID string }
CephDriver maintains context for the ceph driver interface.
func (CephDriver) CopyBlockDevice ¶
func (d CephDriver) CopyBlockDevice(volumeUUID string) (BlockDevice, error)
CopyBlockDevice will copy an existing volume
func (CephDriver) CreateBlockDevice ¶
func (d CephDriver) CreateBlockDevice(imagePath *string, size int) (BlockDevice, error)
CreateBlockDevice will create a rbd image in the ceph cluster.
func (CephDriver) DeleteBlockDevice ¶
func (d CephDriver) DeleteBlockDevice(volumeUUID string) error
DeleteBlockDevice will remove a rbd image from the ceph cluster.
func (CephDriver) GetVolumeMapping ¶
func (d CephDriver) GetVolumeMapping() (map[string][]string, error)
GetVolumeMapping returns a map of volumeUUID to mapped devices.
func (CephDriver) MapVolumeToNode ¶
func (d CephDriver) MapVolumeToNode(volumeUUID string) (string, error)
MapVolumeToNode maps a ceph volume to a rbd device on a node. The path to the new device is returned if the mapping succeeds.
func (CephDriver) UnmapVolumeFromNode ¶
func (d CephDriver) UnmapVolumeFromNode(volumeUUID string) error
UnmapVolumeFromNode unmaps a ceph volume from a local device on a node.
type NoopDriver ¶
type NoopDriver struct {
// contains filtered or unexported fields
}
NoopDriver is a driver which does nothing.
func (*NoopDriver) CopyBlockDevice ¶
func (d *NoopDriver) CopyBlockDevice(string) (BlockDevice, error)
CopyBlockDevice pretends to copy an existing block device
func (*NoopDriver) CreateBlockDevice ¶
func (d *NoopDriver) CreateBlockDevice(image *string, size int) (BlockDevice, error)
CreateBlockDevice pretends to create a block device.
func (*NoopDriver) DeleteBlockDevice ¶
func (d *NoopDriver) DeleteBlockDevice(string) error
DeleteBlockDevice pretends to delete a block device.
func (*NoopDriver) GetVolumeMapping ¶
func (d *NoopDriver) GetVolumeMapping() (map[string][]string, error)
GetVolumeMapping returns an empty slice, indicating no devices are mapped to the specified volume.
func (*NoopDriver) MapVolumeToNode ¶
func (d *NoopDriver) MapVolumeToNode(volumeUUID string) (string, error)
MapVolumeToNode pretends to map a volume to a local device on a node.
func (*NoopDriver) UnmapVolumeFromNode ¶
func (d *NoopDriver) UnmapVolumeFromNode(volumeUUID string) error
UnmapVolumeFromNode pretends to unmap a volume from a local device on a node.