Versions in this module Expand all Collapse all v1 v1.0.0 Apr 11, 2024 Changes in this version + const FakeActionMount + const FakeActionUnmount + func AddSystemdScope(systemdRunPath, mountName, command string, args []string) (string, []string) — linux/amd64 + func AddSystemdScopeSensitive(systemdRunPath, mountName, command string, args []string, ...) (string, []string, string) — linux/amd64 + func CleanupMountPoint(mountPath string, mounter Interface, extensiveMountPointCheck bool) error + func GetDeviceNameFromMount(mounter Interface, mountPath string) (string, int, error) + func IsCorruptedMnt(err error) bool + func IsNotMountPoint(mounter Interface, file string) (bool, error) + func MakeBindOpts(options []string) (bool, []string, []string) + func MakeBindOptsSensitive(options []string, sensitiveOptions []string) (bool, []string, []string, []string) + func MakeMountArgs(source, target, fstype string, options []string) (mountArgs []string) — linux/amd64 + func MakeMountArgsSensitive(source, target, fstype string, options []string, sensitiveOptions []string) (mountArgs []string, mountArgsLogStr string) — linux/amd64 + func NewMountError(mountErrorValue MountErrorType, format string, args ...interface{}) error + func NormalizeWindowsPath(path string) string — windows/amd64 + func PathExists(path string) (bool, error) + func PathWithinBase(fullPath, basePath string) bool + func SearchMountPoints(hostSource, mountInfoPath string) ([]string, error) — linux/amd64 + func StartsWithBackstep(rel string) bool + func ValidateDiskNumber(disk string) error — windows/amd64 + type FakeAction struct + Action string + FSType string + Source string + Target string + type FakeMounter struct + MountCheckErrors map[string]error + MountPoints []MountPoint + UnmountFunc UnmountFunc + func NewFakeMounter(mps []MountPoint) *FakeMounter + func (f *FakeMounter) GetLog() []FakeAction + func (f *FakeMounter) GetMountRefs(pathname string) ([]string, error) + func (f *FakeMounter) IsLikelyNotMountPoint(file string) (bool, error) + func (f *FakeMounter) List() ([]MountPoint, error) + func (f *FakeMounter) Mount(source string, target string, fstype string, options []string) error + func (f *FakeMounter) MountSensitive(source string, target string, fstype string, options []string, ...) error + func (f *FakeMounter) ResetLog() + func (f *FakeMounter) Unmount(target string) error + type Interface interface + GetMountRefs func(pathname string) ([]string, error) + IsLikelyNotMountPoint func(file string) (bool, error) + List func() ([]MountPoint, error) + Mount func(source string, target string, fstype string, options []string) error + MountSensitive func(source string, target string, fstype string, options []string, ...) error + Unmount func(target string) error + func New(mounterPath string) Interface + type MountError struct + Message string + Type MountErrorType + func (mountError MountError) Error() string + func (mountError MountError) String() string + type MountErrorType string + const FilesystemMismatch + const FormatFailed + const GetDiskFormatFailed + const HasFilesystemErrors + const UnformattedReadOnly + const UnknownMountError + type MountInfo struct — darwin/amd64, js/wasm, linux/amd64 + FsType string + ID int + Major int + Minor int + MountOptions []string + MountPoint string + OptionalFields []string + ParentID int + Root string + Source string + SuperOptions []string + func ParseMountInfo(filename string) ([]MountInfo, error) + type MountPoint struct + Device string + Freq int + Opts []string + Pass int + Path string + Type string + func ListProcMounts(mountFilePath string) ([]MountPoint, error) + type Mounter struct + func (*Mounter) List() ([]MountPoint, error) + func (mounter *Mounter) GetMountRefs(pathname string) ([]string, error) + func (mounter *Mounter) IsLikelyNotMountPoint(file string) (bool, error) + func (mounter *Mounter) List() ([]MountPoint, error) + func (mounter *Mounter) Mount(source string, target string, fstype string, options []string) error + func (mounter *Mounter) MountSensitive(source string, target string, fstype string, options []string, ...) error + func (mounter *Mounter) Unmount(target string) error + type SafeFormatAndMount struct + Exec utilexec.Interface + func (mounter *SafeFormatAndMount) FormatAndMount(source string, target string, fstype string, options []string) error + func (mounter *SafeFormatAndMount) FormatAndMountSensitive(source string, target string, fstype string, options []string, ...) error + func (mounter *SafeFormatAndMount) GetDiskFormat(disk string) (string, error) + type UnmountFunc func(path string) error