Documentation ¶
Index ¶
- Variables
- type Filesystem
- type LinuxFilesystem
- func (m *LinuxFilesystem) Format(ctx context.Context, source, fsType string, mkfsArgs []string) error
- func (m *LinuxFilesystem) GetDeviceByID(ctx context.Context, id string) (string, error)
- func (m *LinuxFilesystem) GetDeviceLastPartition(ctx context.Context, device string) (string, error)
- func (m *LinuxFilesystem) IsMounted(ctx context.Context, target string) (bool, error)
- func (m *LinuxFilesystem) Mount(ctx context.Context, source, target, fsType string, opts ...string) error
- func (m *LinuxFilesystem) Statistics(volumePath string) (VolumeStatistics, error)
- func (m *LinuxFilesystem) Unmount(ctx context.Context, target string) error
- type VolumeStatistics
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrToolNotFound = errors.New("tool not found")
)
Functions ¶
This section is empty.
Types ¶
type Filesystem ¶
type Filesystem interface { Format(ctx context.Context, source, fsType string, mkfsArgs []string) error IsMounted(ctx context.Context, target string) (bool, error) Mount(ctx context.Context, source, target, fsType string, opts ...string) error Unmount(ctx context.Context, path string) error Statistics(volumePath string) (VolumeStatistics, error) GetDeviceByID(ctx context.Context, ID string) (string, error) GetDeviceLastPartition(ctx context.Context, source string) (string, error) }
type LinuxFilesystem ¶
type LinuxFilesystem struct {
// contains filtered or unexported fields
}
func NewLinuxFilesystem ¶
func NewLinuxFilesystem(filesystemTypes []string, log *logrus.Entry) (*LinuxFilesystem, error)
func (*LinuxFilesystem) Format ¶
func (m *LinuxFilesystem) Format(ctx context.Context, source, fsType string, mkfsArgs []string) error
Format writes new partition table and creates new partition and filesystem. This function should be idempotent and should eventually lead to success in case off temporary system failure.
func (*LinuxFilesystem) GetDeviceByID ¶
getBlockDeviceByVolumeID returns the absolute path of the attached block device for the given volumeID.
func (*LinuxFilesystem) GetDeviceLastPartition ¶
func (*LinuxFilesystem) IsMounted ¶
IsMounted checks whether the target path is a correct mount (i.e: propagated). It returns true if it's mounted. An error is returned in case of system errors or if it's mounted incorrectly.
func (*LinuxFilesystem) Mount ¶
func (m *LinuxFilesystem) Mount(ctx context.Context, source, target, fsType string, opts ...string) error
Mount mounts source to target with the given fstype and options.
func (*LinuxFilesystem) Statistics ¶
func (m *LinuxFilesystem) Statistics(volumePath string) (VolumeStatistics, error)
filesystemStatistics returns capacity-related volume statistics for the given volume path.
type VolumeStatistics ¶
type VolumeStatistics struct { AvailableBytes, TotalBytes, UsedBytes, AvailableInodes, TotalInodes, UsedInodes int64 }
Click to show internal directories.
Click to hide internal directories.