mountscan

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2016 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeviceNumber

type DeviceNumber struct {
	Major uint
	Minor uint
}

DeviceNumber captures major:minor

type GetMountsRequest

type GetMountsRequest struct {
	DriverName   string // ceph, nfs
	FsType       string // nfs4, ext4
	KernelDriver string // rbd, device-mapper, etc.
}

GetMountsRequest captures all the params required for scanning mountinfo

type MountInfo

type MountInfo struct {
	MountID        uint          // unique mount ID
	ParentID       uint          // ID of the parent mount
	DeviceNumber   *DeviceNumber // Major:Minor device numbers
	Root           string        // path of the directory in the filesystem which is the Root of this mount
	MountPoint     string        // path of the mount point
	MountOptions   string        // per mount options
	OptionalFields string        // in the form of key:value
	Separator      string        // end of optional fields
	FilesystemType string        // e.g ext3, ext4
	MountSource    string
	SuperOptions   string // XXX This field is *not* parsed because it is not present on all systems. It is here as a placeholder.
}

MountInfo captures the mount info read from /proc/self/mountinfo

func GetMounts

func GetMounts(request *GetMountsRequest) ([]*MountInfo, error)

GetMounts captures the list of mounts that satisfies the given criteria (ceph/nfs/..)

Jump to

Keyboard shortcuts

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