Documentation
¶
Index ¶
- func NewDeviceUtils() *deviceUtils
- func NewSafeMounter() *mount.SafeFormatAndMount
- type DeviceUtils
- type FileInterface
- type FileSystem
- type OSFileSystem
- func (OSFileSystem) IsNotExist(err error) bool
- func (OSFileSystem) MkdirAll(path string, perm os.FileMode) error
- func (OSFileSystem) OpenFile(name string, flag int, perm os.FileMode) (FileInterface, error)
- func (OSFileSystem) Remove(path string) error
- func (OSFileSystem) Stat(name string) (fs.FileInfo, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewDeviceUtils ¶
func NewDeviceUtils() *deviceUtils
func NewSafeMounter ¶
func NewSafeMounter() *mount.SafeFormatAndMount
Types ¶
type DeviceUtils ¶
type DeviceUtils interface {
// GetDiskByIdPaths returns a list of all possible paths for a
// given Persistent Disk
GetDiskByIdPaths(deviceName string, partition string) []string
// VerifyDevicePath returns the first of the list of device paths that
// exists on the machine, or an empty string if none exists
VerifyDevicePath(devicePaths []string) (string, error)
}
DeviceUtils are a collection of methods that act on the devices attached to a Linode Instance
type FileInterface ¶ added in v0.8.4
type FileInterface interface {
Close() error
}
type FileSystem ¶ added in v0.8.4
type FileSystem interface {
IsNotExist(err error) bool
MkdirAll(path string, perm os.FileMode) error
Stat(name string) (fs.FileInfo, error)
Remove(path string) error
OpenFile(name string, flag int, perm os.FileMode) (FileInterface, error)
}
FileSystem defines the methods for file system operations.
func NewFileSystem ¶ added in v0.8.4
func NewFileSystem() FileSystem
type OSFileSystem ¶ added in v0.8.4
type OSFileSystem struct{}
OSFileSystem implements FileSystemInterface using the os package.
func (OSFileSystem) IsNotExist ¶ added in v0.8.4
func (OSFileSystem) IsNotExist(err error) bool
func (OSFileSystem) MkdirAll ¶ added in v0.8.4
func (OSFileSystem) MkdirAll(path string, perm os.FileMode) error
func (OSFileSystem) OpenFile ¶ added in v0.8.4
func (OSFileSystem) OpenFile(name string, flag int, perm os.FileMode) (FileInterface, error)
func (OSFileSystem) Remove ¶ added in v0.8.4
func (OSFileSystem) Remove(path string) error
Click to show internal directories.
Click to hide internal directories.