mount

package
v0.4.1-RC1 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2019 License: Apache-2.0 Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeviceMountAttr

type DeviceMountAttr struct {
	DevPath    string // DevPath of the device/block
	MountPoint string // MountPoint of the the device/block
	FileSystem string // FileSystem in the device that is mounted
}

DeviceMountAttr is the struct used for returning all available mount related information like mount point, filesystem type etc. It helps to find mountpoint of a partition/block

type DiskMountUtil

type DiskMountUtil struct {
	// contains filtered or unexported fields
}

DiskMountUtil contains the mountfile path, devpath/mountpoint which can be used to detect partition of a mountpoint or mountpoint of a partition.

func NewMountUtil

func NewMountUtil(filePath, devPath, mountPoint string) DiskMountUtil

NewMountUtil returns DiskMountUtil struct for given mounts file path and mount point

func (DiskMountUtil) GetDiskPath

func (m DiskMountUtil) GetDiskPath() (string, error)

GetDiskPath returns os disk devpath

type Identifier

type Identifier struct {
	DevPath string
}

Identifier is an identifer for the mount probe. It will be a devpath like /dev/sda, /dev/sda1 etc

func (*Identifier) DeviceBasicMountInfo

func (I *Identifier) DeviceBasicMountInfo() (DeviceMountAttr, error)

DeviceBasicMountInfo gives the mount attributes of a device that is attached. The mount attributes include the filesystem type, mountpoint, device path etc. These mount attributes are fetched by parsing a mounts file (/proc/1/mounts) and getting the relevant data. If the device is not mounted, then the function will return an error.

Jump to

Keyboard shortcuts

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