Documentation ¶
Index ¶
- type FakeMounter
- func (m *FakeMounter) DoMount(source string, target string, fstype string, options []string) error
- func (m *FakeMounter) FormatAndMount(source string, target string, fstype string, options []string) error
- func (m *FakeMounter) GetDiskByIdPaths(pdName string, partition string) []string
- func (m *FakeMounter) IsLikelyNotMountPoint(file string) (bool, error)
- func (m *FakeMounter) MkdirAll(path string, perm os.FileMode) error
- func (m *FakeMounter) Remove(name string) error
- func (m *FakeMounter) UnmountVolume(targetPath string) (string, error)
- func (m *FakeMounter) VerifyDevicePath(devicePaths []string) (string, error)
- type GCEMounter
- func (m *GCEMounter) DoMount(source string, target string, fstype string, options []string) error
- func (m *GCEMounter) FormatAndMount(source string, target string, fstype string, options []string) error
- func (m *GCEMounter) GetDiskByIdPaths(pdName string, partition string) []string
- func (m *GCEMounter) IsLikelyNotMountPoint(file string) (bool, error)
- func (m *GCEMounter) MkdirAll(path string, perm os.FileMode) error
- func (m *GCEMounter) Remove(name string) error
- func (m *GCEMounter) UnmountVolume(targetPath string) (string, error)
- func (m *GCEMounter) VerifyDevicePath(devicePaths []string) (string, error)
- type Mounter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FakeMounter ¶
type FakeMounter struct { }
func CreateFakeMounter ¶
func CreateFakeMounter() (*FakeMounter, error)
func (*FakeMounter) FormatAndMount ¶
func (*FakeMounter) GetDiskByIdPaths ¶
func (m *FakeMounter) GetDiskByIdPaths(pdName string, partition string) []string
func (*FakeMounter) IsLikelyNotMountPoint ¶
func (m *FakeMounter) IsLikelyNotMountPoint(file string) (bool, error)
func (*FakeMounter) Remove ¶
func (m *FakeMounter) Remove(name string) error
func (*FakeMounter) UnmountVolume ¶
func (m *FakeMounter) UnmountVolume(targetPath string) (string, error)
func (*FakeMounter) VerifyDevicePath ¶
func (m *FakeMounter) VerifyDevicePath(devicePaths []string) (string, error)
type GCEMounter ¶
type GCEMounter struct { }
func CreateMounter ¶
func CreateMounter() (*GCEMounter, error)
func (*GCEMounter) DoMount ¶
m.DoMount runs the mount command. mounterPath is the path to mounter binary if containerized mounter is used.
func (*GCEMounter) FormatAndMount ¶
func (m *GCEMounter) FormatAndMount(source string, target string, fstype string, options []string) error
formatAndMount uses unix utils to format and mount the given disk
func (*GCEMounter) GetDiskByIdPaths ¶
func (m *GCEMounter) GetDiskByIdPaths(pdName string, partition string) []string
Returns list of all /dev/disk/by-id/* paths for given PD.
func (*GCEMounter) IsLikelyNotMountPoint ¶
func (m *GCEMounter) IsLikelyNotMountPoint(file string) (bool, error)
IsLikelyNotMountPoint determines if a directory is not a mountpoint. It is fast but not necessarily ALWAYS correct. If the path is in fact a bind mount from one part of a mount to another it will not be detected. mkdir /tmp/a /tmp/b; mount --bin /tmp/a /tmp/b; IsLikelyNotMountPoint("/tmp/b") will return true. When in fact /tmp/b is a mount point. If this situation if of interest to you, don't use this function...
func (*GCEMounter) Remove ¶
func (m *GCEMounter) Remove(name string) error
func (*GCEMounter) UnmountVolume ¶
func (m *GCEMounter) UnmountVolume(targetPath string) (string, error)
func (*GCEMounter) VerifyDevicePath ¶
func (m *GCEMounter) VerifyDevicePath(devicePaths []string) (string, error)
Returns the first path that exists, or empty string if none exist.
type Mounter ¶
type Mounter interface { DoMount(source string, target string, fstype string, options []string) error FormatAndMount(source string, target string, fstype string, options []string) error IsLikelyNotMountPoint(file string) (bool, error) UnmountVolume(targetPath string) (string, error) GetDiskByIdPaths(pdName string, partition string) []string VerifyDevicePath(devicePaths []string) (string, error) MkdirAll(path string, perm os.FileMode) error Remove(name string) error }
TODO(dyzz): Should be able to clean up this interface some more. Not everything here needs to be here