Documentation ¶
Index ¶
- func FormatDevice(runner v1.Runner, device string, fileSystem string, label string, ...) error
- func MiBToSectors(size uint, sectorSize uint) uint
- func WithFS(fs v1.FS) func(d *Disk) error
- func WithLogger(logger v1.Logger) func(d *Disk) error
- func WithRunner(runner v1.Runner) func(d *Disk) error
- type Disk
- func (dev *Disk) AddPartition(size uint, fileSystem string, pLabel string, flags ...string) (int, error)
- func (dev *Disk) CheckDiskFreeSpaceMiB(minSpace uint) bool
- func (dev *Disk) Exists() bool
- func (dev *Disk) ExpandLastPartition(size uint) (string, error)
- func (dev Disk) FindPartitionDevice(partNum int) (string, error)
- func (dev Disk) FormatPartition(partNum int, fileSystem string, label string) (string, error)
- func (dev *Disk) GetFreeSpace() (uint, error)
- func (dev Disk) GetLabel() string
- func (dev Disk) GetLastSector() uint
- func (dev Disk) GetSectorSize() uint
- func (dev *Disk) NewPartitionTable(label string) (string, error)
- func (dev *Disk) Reload() error
- func (dev Disk) String() string
- func (dev Disk) WipeFsOnPartition(device string) error
- type DiskOptions
- type MkfsCall
- type PartedCall
- func (pc *PartedCall) CreatePartition(p *Partition)
- func (pc *PartedCall) DeletePartition(num int)
- func (pc PartedCall) GetLastSector(printOut string) (uint, error)
- func (pc PartedCall) GetPartitionTableLabel(printOut string) (string, error)
- func (pc PartedCall) GetPartitions(printOut string) []Partition
- func (pc PartedCall) GetSectorSize(printOut string) (uint, error)
- func (pc PartedCall) Print() (string, error)
- func (pc *PartedCall) SetPartitionFlag(num int, flag string, active bool)
- func (pc *PartedCall) SetPartitionTableLabel(label string)
- func (pc *PartedCall) WipeTable(wipe bool)
- func (pc *PartedCall) WriteChanges() (string, error)
- type Partition
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatDevice ¶
func FormatDevice(runner v1.Runner, device string, fileSystem string, label string, opts ...string) error
FormatDevice formats a block device with the given parameters
func MiBToSectors ¶
Types ¶
type Disk ¶
type Disk struct {
// contains filtered or unexported fields
}
func NewDisk ¶
func NewDisk(device string, opts ...DiskOptions) *Disk
func (*Disk) AddPartition ¶
func (dev *Disk) AddPartition(size uint, fileSystem string, pLabel string, flags ...string) (int, error)
AddPartition adds a partition. Size is expressed in MiB here Size is expressed in MiB here
func (*Disk) CheckDiskFreeSpaceMiB ¶
Size is expressed in MiB here
func (*Disk) ExpandLastPartition ¶
ExpandLastPartition expands the latest partition in the disk. Size is expressed in MiB here Size is expressed in MiB here
func (Disk) FormatPartition ¶
func (*Disk) GetFreeSpace ¶
func (Disk) GetLastSector ¶
func (Disk) GetSectorSize ¶
func (Disk) WipeFsOnPartition ¶
type DiskOptions ¶
type MkfsCall ¶
type MkfsCall struct {
// contains filtered or unexported fields
}
func NewMkfsCall ¶
type PartedCall ¶
type PartedCall struct {
// contains filtered or unexported fields
}
func NewPartedCall ¶
func NewPartedCall(dev string, runner v1.Runner) *PartedCall
func (*PartedCall) CreatePartition ¶
func (pc *PartedCall) CreatePartition(p *Partition)
func (*PartedCall) DeletePartition ¶
func (pc *PartedCall) DeletePartition(num int)
func (PartedCall) GetLastSector ¶
func (pc PartedCall) GetLastSector(printOut string) (uint, error)
Parses the output of a PartedCall.Print call
func (PartedCall) GetPartitionTableLabel ¶
func (pc PartedCall) GetPartitionTableLabel(printOut string) (string, error)
Parses the output of a PartedCall.Print call
func (PartedCall) GetPartitions ¶
func (pc PartedCall) GetPartitions(printOut string) []Partition
Parses the output of a GdiskCall.Print call
func (PartedCall) GetSectorSize ¶
func (pc PartedCall) GetSectorSize(printOut string) (uint, error)
Parses the output of a PartedCall.Print call
func (PartedCall) Print ¶
func (pc PartedCall) Print() (string, error)
func (*PartedCall) SetPartitionFlag ¶
func (pc *PartedCall) SetPartitionFlag(num int, flag string, active bool)
func (*PartedCall) SetPartitionTableLabel ¶
func (pc *PartedCall) SetPartitionTableLabel(label string)
func (*PartedCall) WipeTable ¶
func (pc *PartedCall) WipeTable(wipe bool)
func (*PartedCall) WriteChanges ¶
func (pc *PartedCall) WriteChanges() (string, error)
Click to show internal directories.
Click to hide internal directories.