fs

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2017 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FstypeDefault contains the default FS to be used when not specified by the user.
	FstypeDefault = "ext4"
)

Variables

View Source
var BinSearchPath = []string{"/bin", "/sbin", "/usr/bin", "/usr/sbin"}

BinSearchPath contains search paths for host binaries

Functions

func DeleteDevicePathWithID

func DeleteDevicePathWithID(id string) error

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

func DevAttachWaitPrep() (*fsnotify.Watcher, error)

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

func GetDevicePathByID(id string) (string, error)

GetDevicePathByID - return full path for device with given ID

func GetMountInfo

func GetMountInfo(mountRoot string) (map[string]string, error)

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

func GetMountRootEntries(mountRoot string) ([]string, error)

GetMountRootEntries returns the list of volumes under mountRoot

func Mkdir

func Mkdir(path string) error

Mkdir creates a directory at the specified path.

func Mkfs

func Mkfs(fstype string, label string, volDev *VolumeDevSpec) error

Mkfs creates a filesystem at the specified volDev.

func MkfsByDevicePath

func MkfsByDevicePath(fstype string, label string, device string) error

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

func MountByDevicePath(mountpoint string, fstype string, device string, isReadOnly bool) error

MountByDevicePath mounts the filesystem (`fs`) on the device at the given mount point.

func MountWithID

func MountWithID(mountpoint string, fstype string, id string, isReadOnly bool) error

MountWithID - mount device with ID

func Rmdir

func Rmdir(path string) error

Rmdir removes a directory identified by its path

func Unmount

func Unmount(mountPoint string) error

Unmount a device from the given mount point.

func VerifyFSSupport

func VerifyFSSupport(fstype string) error

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

Jump to

Keyboard shortcuts

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