Documentation
¶
Index ¶
- Constants
- type LocalDriver
- type VolumeDriver
- type VolumeManager
- func (vm *VolumeManager) CreateVolume(volume *types.Volume) error
- func (vm *VolumeManager) DeleteVolume(volume *types.Volume) error
- func (vm *VolumeManager) GetDriver(driverName string) (VolumeDriver, error)
- func (vm *VolumeManager) MountVolume(volume *types.Volume) (string, error)
- func (vm *VolumeManager) UnmountVolume(volume *types.Volume) error
Constants ¶
View Source
const (
// DefaultVolumesPath is the base directory for local volumes
DefaultVolumesPath = "/var/lib/warren/volumes"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LocalDriver ¶
type LocalDriver struct {
// contains filtered or unexported fields
}
LocalDriver implements a simple local volume driver
func NewLocalDriver ¶
func NewLocalDriver(basePath string) (*LocalDriver, error)
NewLocalDriver creates a new local volume driver
func (*LocalDriver) Create ¶
func (d *LocalDriver) Create(volume *types.Volume) error
Create creates a new local volume directory
func (*LocalDriver) Delete ¶
func (d *LocalDriver) Delete(volume *types.Volume) error
Delete removes a local volume directory
func (*LocalDriver) GetPath ¶
func (d *LocalDriver) GetPath(volume *types.Volume) string
GetPath returns the host path for a volume
type VolumeDriver ¶
type VolumeDriver interface {
// Create creates a new volume
Create(volume *types.Volume) error
// Delete removes a volume
Delete(volume *types.Volume) error
// Mount returns the host path for mounting to containers
Mount(volume *types.Volume) (string, error)
// Unmount performs cleanup after unmounting
Unmount(volume *types.Volume) error
// GetPath returns the host path for a volume
GetPath(volume *types.Volume) string
}
VolumeDriver defines the interface for volume drivers
type VolumeManager ¶
type VolumeManager struct {
// contains filtered or unexported fields
}
VolumeManager manages volume operations
func NewVolumeManager ¶
func NewVolumeManager() (*VolumeManager, error)
NewVolumeManager creates a new volume manager
func (*VolumeManager) CreateVolume ¶
func (vm *VolumeManager) CreateVolume(volume *types.Volume) error
CreateVolume creates a volume using the appropriate driver
func (*VolumeManager) DeleteVolume ¶
func (vm *VolumeManager) DeleteVolume(volume *types.Volume) error
DeleteVolume deletes a volume using the appropriate driver
func (*VolumeManager) GetDriver ¶
func (vm *VolumeManager) GetDriver(driverName string) (VolumeDriver, error)
GetDriver returns the driver for a volume
func (*VolumeManager) MountVolume ¶
func (vm *VolumeManager) MountVolume(volume *types.Volume) (string, error)
MountVolume returns the mount path for a volume
func (*VolumeManager) UnmountVolume ¶
func (vm *VolumeManager) UnmountVolume(volume *types.Volume) error
UnmountVolume performs cleanup after unmounting
Click to show internal directories.
Click to hide internal directories.