Documentation
¶
Index ¶
- func BindMount(source, target, fsType string, recursive, readOnly bool, ...) error
- func GetDeviceByFSUUID(fsuuid string) (device string, err error)
- func Mkdir(name string, perm os.FileMode) (err error)
- func Mount(device, target, fsType string, flags []string, superBlockFlags string) error
- func Unmount(target string, force, detach, expire bool) error
- type ErrMountPointAlreadyMounted
- type MountEntry
- type MountInfo
- func (info *MountInfo) FilterByMajorMinor(value string) *MountInfo
- func (info *MountInfo) FilterByMountPoint(value string) *MountInfo
- func (info *MountInfo) FilterByMountSource(value string) *MountInfo
- func (info *MountInfo) FilterByRoot(value string) *MountInfo
- func (info *MountInfo) IsEmpty() bool
- func (info *MountInfo) Length() int
- func (info *MountInfo) List() (mounts []*MountEntry)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BindMount ¶
func BindMount(source, target, fsType string, recursive, readOnly bool, superBlockFlags string) error
BindMount does bind-mount of source to target.
func GetDeviceByFSUUID ¶
GetDeviceByFSUUID get device name by it's FSUUID.
Types ¶
type ErrMountPointAlreadyMounted ¶
ErrMountPointAlreadyMounted denotes mount point already mounted error.
func (*ErrMountPointAlreadyMounted) Error ¶
func (e *ErrMountPointAlreadyMounted) Error() string
Error is error interface compatible method.
type MountEntry ¶
type MountEntry struct {
MountID string
ParentID string
MajorMinor string
Root string
MountPoint string
MountOptions utils.StringSet
OptionalFields []string
FilesystemType string
MountSource string
// contains filtered or unexported fields
}
MountEntry contains single mount information from /proc/self/mountinfo
func (MountEntry) String ¶
func (m MountEntry) String() string
type MountInfo ¶
type MountInfo struct {
// contains filtered or unexported fields
}
MountInfo contains multiple mount information from /proc/self/mountinfo
func FakeMountInfo ¶
func FakeMountInfo(mountEntries ...MountEntry) *MountInfo
FakeMountInfo creates mount information with tesing mount entries
func NewMountInfo ¶
NewMountInfo creates mount information from /proc/self/mountinfo
func (*MountInfo) FilterByMajorMinor ¶
FilterByMajorMinor returns mount information filtered by major:minor
func (*MountInfo) FilterByMountPoint ¶
FilterByMountPoint returns mount information filtered by mount point
func (*MountInfo) FilterByMountSource ¶
FilterByMountSource returns mount information filtered by mount source
func (*MountInfo) FilterByRoot ¶
FilterByRoot returns mount information filtered by root mount point
func (*MountInfo) List ¶
func (info *MountInfo) List() (mounts []*MountEntry)
List returns list of mount entries available