Documentation ¶
Index ¶
- Constants
- Variables
- func DeleteDevicePathWithID(id string) error
- func DevAttachWait(watcher *fsnotify.Watcher, volDev *VolumeDevSpec) (string, error)
- func DevAttachWaitFallback()
- func DevAttachWaitPrep() (*fsnotify.Watcher, error)
- func GetDevicePath(volDev *VolumeDevSpec) (string, error)
- func GetDevicePathByID(id string) (string, error)
- func GetMountInfo(mountRoot string) (map[string]string, error)
- func GetMountRootEntries(mountRoot string) ([]string, error)
- func Mkdir(path string) error
- func Mkfs(fstype string, label string, volDev *VolumeDevSpec) error
- func MkfsByDevicePath(fstype string, label string, device string) error
- func Mount(mountpoint string, fstype string, volDev *VolumeDevSpec, isReadOnly bool) error
- func MountByDevicePath(mountpoint string, fstype string, device string, isReadOnly bool) error
- func MountWithID(mountpoint string, fstype string, id string, isReadOnly bool) error
- func Rmdir(path string) error
- func Unmount(mountPoint string) error
- func VerifyFSSupport(fstype string) error
- type VolumeDevSpec
Constants ¶
const (
// FstypeDefault contains the default FS to be used when not specified by the user.
FstypeDefault = "ext4"
)
Variables ¶
var BinSearchPath = []string{"/bin", "/sbin", "/usr/bin", "/usr/sbin"}
BinSearchPath contains search paths for host binaries
Functions ¶
func DeleteDevicePathWithID ¶
DeleteDevicePathWithID - delete device with given ID
func DevAttachWait ¶
func DevAttachWait( watcher *fsnotify.Watcher, volDev *VolumeDevSpec) (string, error)
DevAttachWait waits for attach operation to be completed
func DevAttachWaitFallback ¶
func DevAttachWaitFallback()
DevAttachWaitFallback performs basic fallback in case of watch failure.
func DevAttachWaitPrep ¶
DevAttachWaitPrep creates a watcher that watches disk events.
func GetDevicePath ¶
func GetDevicePath(volDev *VolumeDevSpec) (string, error)
GetDevicePath returns the device path or error.
func GetDevicePathByID ¶
GetDevicePathByID - return full path for device with given ID
func GetMountInfo ¶
GetMountInfo returns a map of mounted volumes and devices if available. It creates a map of all volumes that are in use or may have been in use earlier and creates the map of volume to device.
func GetMountRootEntries ¶
GetMountRootEntries returns the list of volumes under mountRoot
func Mkfs ¶
func Mkfs(fstype string, label string, volDev *VolumeDevSpec) error
Mkfs creates a filesystem at the specified volDev.
func MkfsByDevicePath ¶
MkfsByDevicePath creates a filesystem at the specified device.
func Mount ¶
func Mount(mountpoint string, fstype string, volDev *VolumeDevSpec, isReadOnly bool) error
Mount the filesystem (`fs`) on the volDev at the given mountpoint.
func MountByDevicePath ¶
MountByDevicePath mounts the filesystem (`fs`) on the device at the given mount point.
func MountWithID ¶
MountWithID - mount device with ID
func VerifyFSSupport ¶
VerifyFSSupport checks whether the fstype filesystem is supported.
Types ¶
type VolumeDevSpec ¶
type VolumeDevSpec struct { Unit string ControllerPciSlotNumber string ControllerPciBusNumber string }
VolumeDevSpec - volume spec returned from the server on an attach