mounter

package
v3.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

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)

func (Mounter) GetMountRefs

func (m Mounter) GetMountRefs(path string) ([]string, error)

func (Mounter) IsMountPoint

func (m Mounter) IsMountPoint(path string) (bool, error)

func (Mounter) Mount

func (m Mounter) Mount(source string, target string, fstype string, options []string) error

func (Mounter) Unmount

func (m Mounter) Unmount(target string) error

Jump to

Keyboard shortcuts

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