Documentation ¶
Index ¶
Constants ¶
const ( // HostMountsFilePath is the default path of // the mounts file mounted inside container HostMountsFilePath = "/host/proc/1/mounts" )
Variables ¶
var ErrCouldNotFindRootDevice = fmt.Errorf("could not find root device")
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 identifier for the mount probe. It will be a devpath like /dev/sda, /dev/sda1 etc
func (*Identifier) DeviceBasicMountInfo ¶
func (I *Identifier) DeviceBasicMountInfo(mountsFilePath string) (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.