mount

package
v0.0.0-...-ebe7275 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: BSD-2-Clause-Patent Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider struct {
	// contains filtered or unexported fields
}

Provider provides methods to interact with a generic storage device.

func DefaultProvider

func DefaultProvider(log logging.Logger) *Provider

DefaultProvider returns an initialized *Provider suitable for use with production code.

func NewProvider

func NewProvider(log logging.Logger, sys SystemProvider) *Provider

NewProvider returns an initialized *Provider.

func (*Provider) ClearMountpoint

func (p *Provider) ClearMountpoint(mntpt string) error

ClearMountpoint unmounts and removes a mountpoint.

func (*Provider) IsMounted

func (p *Provider) IsMounted(target string) (bool, error)

IsMounted checks whether the requested path is mounted.

func (*Provider) MakeMountPath

func (p *Provider) MakeMountPath(path string, tgtUID, tgtGID int) error

MakeMountPath will build the target path by creating any non-existent subdirectories and setting ownership to target uid/gid to ensure that the target user is able to access the created mount point if multiple layers deep. If subdirectories in path already exist, their permissions will not be modified.

func (*Provider) Mount

Mount mounts a given device with a set of arguments.

func (*Provider) Unmount

Unmount unmounts a device from a mount point.

type SystemProvider

type SystemProvider interface {
	system.IsMountedProvider
	system.MountProvider
	system.UnmountProvider
	Chmod(string, os.FileMode) error
	Chown(string, int, int) error
	Getegid() int
	Geteuid() int
	Mkdir(string, os.FileMode) error
	RemoveAll(string) error
	Stat(string) (os.FileInfo, error)
}

SystemProvider provides operating system capabilities.

Jump to

Keyboard shortcuts

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