Documentation ¶
Index ¶
- Variables
- type CustomLoad
- type CustomMounter
- type CustomMounterHandler
- type CustomReload
- type DefaultMounter
- type DeviceMap
- type DeviceMounter
- type Info
- type Manager
- type MountImpl
- type MountType
- type Mounter
- func (m *Mounter) EmptyTrashDir() error
- func (m *Mounter) Exists(sourcePath string, path string) (bool, error)
- func (m *Mounter) GetSourcePath(mountPath string) (string, error)
- func (m *Mounter) GetSourcePaths() []string
- func (m *Mounter) HasMounts(sourcePath string) int
- func (m *Mounter) HasTarget(targetPath string) (string, bool)
- func (m *Mounter) Inspect(sourcePath string) []*PathInfo
- func (m *Mounter) Mount(minor int, devPath, path, fs string, flags uintptr, data string, timeout int, ...) error
- func (m *Mounter) Mounts(sourcePath string) []string
- func (m *Mounter) RemoveMountPath(mountPath string, opts map[string]string) error
- func (m *Mounter) String() string
- func (m *Mounter) Unmount(devPath string, path string, flags int, timeout int, opts map[string]string) error
- type NFSMounter
- type PathInfo
- type PathMap
Constants ¶
This section is empty.
Variables ¶
var ( // ErrExist is returned if path is already mounted to a different device. ErrExist = errors.New("Mountpath already exists") // ErrEnoent is returned for a non existent mount point ErrEnoent = errors.New("Mountpath is not mounted") // ErrEinval is returned is fields for an entry do no match // existing fields ErrEinval = errors.New("Invalid arguments for mount entry") // ErrUnsupported is returned for an unsupported operation or a mount type. ErrUnsupported = errors.New("Not supported") // ErrMountpathNotAllowed is returned when the requested mountpath is not // a part of the provided allowed mount paths ErrMountpathNotAllowed = errors.New("Mountpath is not allowed") )
Functions ¶
This section is empty.
Types ¶
type CustomLoad ¶
CustomLoad defines the mounter.Load callback function for customer mounters
type CustomMounter ¶
type CustomMounter func() (CustomLoad, CustomReload)
CustomMounter defines the CustomMount function that retursn the load and reload callbacks
type CustomMounterHandler ¶
type CustomMounterHandler struct { Mounter // contains filtered or unexported fields }
CustomMounterHandler implements the Mounter interface
func NewCustomMounter ¶
func NewCustomMounter( devPrefixes []string, mountImpl MountImpl, customMounter CustomMounter, allowedDirs []string, ) (*CustomMounterHandler, error)
NewCustomMounter returns a new CustomMounter
func (*CustomMounterHandler) Load ¶
func (c *CustomMounterHandler) Load(devPrefixes []string) error
Load mount table
func (*CustomMounterHandler) Reload ¶
func (c *CustomMounterHandler) Reload(device string) error
Reload mount table for a device
type CustomReload ¶
CustomReload defines the mounter.Reload callback function for customer mounters
type DefaultMounter ¶
type DefaultMounter struct { }
DefaultMounter defaults to syscall implementation.
type DeviceMounter ¶
type DeviceMounter struct {
Mounter
}
DeviceMounter implements Ops and tracks active mounts for volume drivers.
func NewDeviceMounter ¶
func NewDeviceMounter( devPrefixes []string, mountImpl MountImpl, allowedDirs []string, trashLocation string, ) (*DeviceMounter, error)
NewDeviceMounter returns a new DeviceMounter
func (*DeviceMounter) Load ¶
func (m *DeviceMounter) Load(devPrefixes []string) error
Load mount table
func (*DeviceMounter) Reload ¶
func (m *DeviceMounter) Reload(device string) error
Reload reloads the mount table
type Manager ¶
type Manager interface { // String representation of the mount table String() string // Reload mount table for specified device. Reload(source string) error // Load mount table for all devices that match the list of identifiers Load(source []string) error // Inspect mount table for specified source. ErrEnoent may be returned. Inspect(source string) []*PathInfo // Mounts returns paths for specified source. Mounts(source string) []string // HasMounts determines returns the number of mounts for the source. HasMounts(source string) int // HasTarget determines returns the number of mounts for the target. HasTarget(target string) (string, bool) // Exists returns true if the device is mounted at specified path. // returned if the device does not exists. Exists(source, path string) (bool, error) // GetSourcePath scans mount for a specified mountPath and returns the // sourcePath if found or returnes an ErrEnoent GetSourcePath(mountPath string) (string, error) // GetSourcePaths returns all source paths from the mount table GetSourcePaths() []string // Mount device at mountpoint Mount( minor int, device string, path string, fs string, flags uintptr, data string, timeout int, opts map[string]string) error // Unmount device at mountpoint and remove from the matrix. // ErrEnoent is returned if the device or mountpoint for the device // is not found. Unmount(source, path string, flags int, timeout int, opts map[string]string) error // RemoveMountPath removes the given path RemoveMountPath(path string, opts map[string]string) error // EmptyTrashDir removes all directories from the mounter trash directory EmptyTrashDir() error }
Manager defines the interface for keep track of volume driver mounts.
type MountImpl ¶
type MountImpl interface { Mount(source, target, fstype string, flags uintptr, data string, timeout int) error Unmount(target string, flags int, timeout int) error }
MountImpl backend implementation for Mount/Unmount calls
type Mounter ¶
Mounter implements Ops and keeps track of active mounts for volume drivers.
func (*Mounter) EmptyTrashDir ¶
func (*Mounter) Exists ¶
Exists scans mountpaths for specified device and returns true if path is one of the mountpaths. ErrEnoent may be retuned if the device is not found
func (*Mounter) GetSourcePath ¶
GetSourcePath scans mount for a specified mountPath and returns the sourcePath if found or returnes an ErrEnoent
func (*Mounter) GetSourcePaths ¶
GetSourcePaths returns all source paths from the mount table
func (*Mounter) Mount ¶
func (m *Mounter) Mount( minor int, devPath, path, fs string, flags uintptr, data string, timeout int, opts map[string]string, ) error
Mount new mountpoint for specified device.
func (*Mounter) RemoveMountPath ¶
RemoveMountPath makes the path writeable and removes it after a fixed delay
type NFSMounter ¶
type NFSMounter struct { Mounter // contains filtered or unexported fields }
NFSMounter implements Manager and keeps track of active mounts for volume drivers.
func (*NFSMounter) Reload ¶
func (m *NFSMounter) Reload(device string) error
Reload reloads the mount table for the specified device