nsenter

package
v1.15.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Mounter

type Mounter struct{}

Mounter provides the mount.Interface implementation for unsupported platforms.

func NewMounter

func NewMounter(rootDir string, ne *nsenter.Nsenter) *Mounter

NewMounter returns a new Mounter for the current system

func (*Mounter) DeviceOpened

func (*Mounter) DeviceOpened(pathname string) (bool, error)

DeviceOpened checks if block device in use. I tis a noop for unsupported systems

func (*Mounter) EvalHostSymlinks(pathname string) (string, error)

EvalHostSymlinks returns the path name after evaluating symlinks. Always returns an error on unsupported platforms

func (*Mounter) ExistsPath

func (*Mounter) ExistsPath(pathname string) (bool, error)

ExistsPath checks if pathname exists. Always returns an error on unsupported platforms

func (*Mounter) GetDeviceNameFromMount

func (*Mounter) GetDeviceNameFromMount(mountPath, pluginMountDir string) (string, error)

GetDeviceNameFromMount finds the device name from its global mount point using the given mountpath and plugin location. It is a noop of unsupported platforms

func (*Mounter) GetFSGroup

func (*Mounter) GetFSGroup(pathname string) (int64, error)

GetFSGroup returns FSGroup of pathname. Always returns an error on unsupported platforms

func (*Mounter) GetFileType

func (*Mounter) GetFileType(_ string) (mount.FileType, error)

GetFileType checks for file/directory/socket/block/character devices. Always returns an error and "fake" filetype on unsupported platforms

func (*Mounter) GetMode

func (*Mounter) GetMode(pathname string) (os.FileMode, error)

GetMode returns permissions of pathname. Always returns an error on unsupported platforms

func (*Mounter) GetMountRefs

func (*Mounter) GetMountRefs(pathname string) ([]string, error)

GetMountRefs finds all mount references to the path, returns a list of paths. Always returns an error on unsupported platforms

func (*Mounter) GetSELinuxSupport

func (*Mounter) GetSELinuxSupport(pathname string) (bool, error)

GetSELinuxSupport tests if pathname is on a mount that supports SELinux. Always returns an error on unsupported platforms

func (*Mounter) IsLikelyNotMountPoint

func (*Mounter) IsLikelyNotMountPoint(file string) (bool, error)

IsLikelyNotMountPoint determines if a directory is not a mountpoint. It is a noop on unsupported systems

func (*Mounter) IsMountPointMatch

func (*Mounter) IsMountPointMatch(mp mount.MountPoint, dir string) bool

IsMountPointMatch tests if dir and mp are the same path

func (*Mounter) List

func (*Mounter) List() ([]mount.MountPoint, error)

List returns a list of all mounted filesystems. It is a noop for unsupported systems

func (*Mounter) MakeDir

func (*Mounter) MakeDir(pathname string) error

MakeDir creates a new directory. Noop on unsupported platforms

func (*Mounter) MakeFile

func (*Mounter) MakeFile(pathname string) error

MakeFile creats an empty file. Noop on unsupported platforms

func (*Mounter) MakeRShared

func (*Mounter) MakeRShared(path string) error

MakeRShared checks if path is shared and bind-mounts it as rshared if needed. It is a noop on unsupported platforms

func (*Mounter) Mount

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

Mount mounts the source to the target. It is a noop for unsupported systems

func (*Mounter) PathIsDevice

func (*Mounter) PathIsDevice(pathname string) (bool, error)

PathIsDevice checks if pathname refers to a device. It is a noop for unsupported systems

func (*Mounter) Unmount

func (*Mounter) Unmount(target string) error

Unmount unmounts the target path from the system. it is a noop for unsupported systems

Jump to

Keyboard shortcuts

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