volume

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

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

func (*LocalDriver) Mount

func (d *LocalDriver) Mount(volume *types.Volume) (string, error)

Mount returns the host path for bind mounting to containers

func (*LocalDriver) Unmount

func (d *LocalDriver) Unmount(volume *types.Volume) error

Unmount performs cleanup (no-op for local driver)

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

Jump to

Keyboard shortcuts

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