Documentation ¶
Overview ¶
Package mount handles filesystem mount operations.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type NewPointOption ¶
type NewPointOption func(*Point)
NewPointOption is a mount point option.
func WithProjectQuota ¶
func WithProjectQuota(enabled bool) NewPointOption
WithProjectQuota sets the project quota flag.
type OperationOption ¶
type OperationOption func(*OperationOptions)
OperationOption is a mount option.
func WithMountPrinter ¶
func WithMountPrinter(printer func(string, ...any)) OperationOption
WithMountPrinter sets the printer.
func WithSkipIfMounted ¶
func WithSkipIfMounted() OperationOption
WithSkipIfMounted sets the skip if mounted flag.
type OperationOptions ¶
type OperationOptions struct { PrinterOptions SkipIfMounted bool TargetMode os.FileMode }
OperationOptions are mount options.
type Point ¶
type Point struct {
// contains filtered or unexported fields
}
Point represents a mount point.
func NewPoint ¶
func NewPoint(source, target, fstype string, opts ...NewPointOption) *Point
NewPoint creates a new mount point.
func (*Point) IsMounted ¶
IsMounted checks if the mount point is mounted by checking the mount on the target.
func (*Point) Mount ¶
func (p *Point) Mount(opts ...OperationOption) (unmounter func() error, err error)
Mount the mount point.
Mount returns an unmounter function to unmount the mount point.
func (*Point) Unmount ¶
func (p *Point) Unmount(opts ...UnmountOption) error
Unmount the mount point.
type Points ¶
type Points []*Point
Points is a list of mount points.
type PrinterOptions ¶
PrinterOptions are printer options.
func (PrinterOptions) Printf ¶
func (o PrinterOptions) Printf(format string, args ...any)
Printf prints a formatted string (or skips if printer is nil).
type UnmountOption ¶
type UnmountOption func(*UnmountOptions)
UnmountOption is an unmount option.
func WithUnmountPrinter ¶
func WithUnmountPrinter(printer func(string, ...any)) UnmountOption
WithUnmountPrinter sets the printer.
type UnmountOptions ¶
type UnmountOptions struct {
PrinterOptions
}
UnmountOptions is unmount options.