Documentation
¶
Index ¶
- type Interface
- type MountPoint
- type Mounter
- func (m Mounter) GetMountPoints(device string) ([]MountPoint, error)
- func (m Mounter) GetMountRefs(path string) ([]string, error)
- func (m Mounter) IsMountPoint(path string) (bool, error)
- func (m Mounter) Mount(source string, target string, fstype string, options []string) error
- func (m Mounter) Unmount(target string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Interface ¶
type Interface interface {
Mount(source string, target string, fstype string, options []string) error
Unmount(target string) error
// IsMountPoint check /proc/mounts or equivalent data to check if the given path is listed there
IsMountPoint(path string) (bool, error)
// GetMountRefs finds all mount references to pathname, returning a slice of
// paths. The returned slice does not include the given path.
GetMountRefs(pathname string) ([]string, error)
// GetMountPoints parses /proc/mounts or equivalent data to fetch all available mountpoints for the given device
GetMountPoints(device string) ([]MountPoint, error)
}
type MountPoint ¶
type MountPoint struct {
Device string
Path string
Type string
Opts []string // Opts may contain sensitive mount options (like passwords) and MUST be treated as such (e.g. not logged).
}
MountPoint represents a single line in /proc/mounts or /etc/fstab.
type Mounter ¶
type Mounter struct {
// contains filtered or unexported fields
}
func NewMounter ¶
func NewMounter() *Mounter
func (Mounter) GetMountPoints ¶
func (m Mounter) GetMountPoints(device string) ([]MountPoint, error)
Click to show internal directories.
Click to hide internal directories.