Documentation
¶
Overview ¶
Package mount provides utilities to detect, format and mount storage devices.
Index ¶
- type Mounter
- type NodeMounter
- func (m *NodeMounter) GetBlockSizeBytes(devicePath string) (int64, error)
- func (m *NodeMounter) GetDeviceNameFromMount(mountPath string) (string, int, error)
- func (m *NodeMounter) GetDevicePath(ctx context.Context, volumeID string) (string, error)
- func (m *NodeMounter) GetStatistics(volumePath string) (VolumeStatistics, error)
- func (m *NodeMounter) IsBlockDevice(devicePath string) (bool, error)
- func (m *NodeMounter) IsCorruptedMnt(err error) bool
- func (*NodeMounter) MakeDir(path string) error
- func (*NodeMounter) MakeFile(path string) error
- func (m *NodeMounter) NeedResize(devicePath string, deviceMountPath string) (bool, error)
- func (*NodeMounter) PathExists(path string) (bool, error)
- func (m *NodeMounter) Resize(devicePath, deviceMountPath string) (bool, error)
- func (m *NodeMounter) Unpublish(path string) error
- func (m *NodeMounter) Unstage(path string) error
- type VolumeStatistics
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Mounter ¶ added in v0.8.1
type Mounter interface { mount.Interface FormatAndMount(source string, target string, fstype string, options []string) error GetBlockSizeBytes(devicePath string) (int64, error) GetDevicePath(ctx context.Context, volumeID string) (string, error) GetDeviceNameFromMount(mountPath string) (string, int, error) GetStatistics(volumePath string) (VolumeStatistics, error) IsBlockDevice(devicePath string) (bool, error) IsCorruptedMnt(err error) bool MakeDir(path string) error MakeFile(path string) error NeedResize(devicePath string, deviceMountPath string) (bool, error) PathExists(path string) (bool, error) Resize(devicePath, deviceMountPath string) (bool, error) Unpublish(path string) error Unstage(path string) error }
Mounter defines the set of methods to allow for mount operations on a system.
type NodeMounter ¶ added in v0.8.1
type NodeMounter struct {
*mount.SafeFormatAndMount
}
NodeMounter implements Mounter. A superstruct of SafeFormatAndMount.
func (*NodeMounter) GetBlockSizeBytes ¶ added in v0.8.1
func (m *NodeMounter) GetBlockSizeBytes(devicePath string) (int64, error)
GetBlockSizeBytes gets the size of the disk in bytes.
func (*NodeMounter) GetDeviceNameFromMount ¶ added in v0.8.1
func (m *NodeMounter) GetDeviceNameFromMount(mountPath string) (string, int, error)
func (*NodeMounter) GetDevicePath ¶ added in v0.8.1
func (*NodeMounter) GetStatistics ¶ added in v0.8.1
func (m *NodeMounter) GetStatistics(volumePath string) (VolumeStatistics, error)
GetStatistics gathers statistics on the volume.
func (*NodeMounter) IsBlockDevice ¶ added in v0.8.1
func (m *NodeMounter) IsBlockDevice(devicePath string) (bool, error)
IsBlockDevice checks if the given path is a block device.
func (*NodeMounter) IsCorruptedMnt ¶ added in v0.8.1
func (m *NodeMounter) IsCorruptedMnt(err error) bool
IsCorruptedMnt return true if err is about corrupted mount point.
func (*NodeMounter) MakeDir ¶ added in v0.8.1
func (*NodeMounter) MakeDir(path string) error
func (*NodeMounter) MakeFile ¶ added in v0.8.1
func (*NodeMounter) MakeFile(path string) error
func (*NodeMounter) NeedResize ¶ added in v0.8.1
func (m *NodeMounter) NeedResize(devicePath string, deviceMountPath string) (bool, error)
NeedResize checks if the filesystem of the given devicePath needs to be resized.
func (*NodeMounter) PathExists ¶ added in v0.8.1
func (*NodeMounter) PathExists(path string) (bool, error)
func (*NodeMounter) Resize ¶ added in v0.8.1
func (m *NodeMounter) Resize(devicePath, deviceMountPath string) (bool, error)
Resize resizes the filesystem of the given devicePath.
func (*NodeMounter) Unpublish ¶ added in v0.8.1
func (m *NodeMounter) Unpublish(path string) error
Unpublish unmounts the given path.
func (*NodeMounter) Unstage ¶ added in v0.8.1
func (m *NodeMounter) Unstage(path string) error
Unstage unmounts the given path.