Documentation ¶
Overview ¶
Package disk contains disk and plot related operations
Index ¶
Constants ¶
const ( Byte = 1 KiB = 1024 * Byte MiB = 1024 * KiB GiB = 1024 * MiB TiB = 1024 * GiB )
Variables ¶
var Statfs = syscall.Statfs
Statfs represents the syscall to get the Statfs information
Functions ¶
This section is empty.
Types ¶
type Disk ¶
type Disk struct { // Path represents a directory path Path string // Total represents the total disk space Total Space // Free represents the free/available disk space Free Space // Used represents the used disk space Used Space }
Disk represents abstraction of a disk
type PlotInfo ¶
type PlotInfo struct { *Disk // reserved represents the amount of plots to be reserved when evaluating how many plots are left Reserved uint64 }
PlotInfo gives further plot related information of a Disk
func (PlotInfo) PlotsLeft ¶
PlotsLeft calculates the amount of plots which can still be stored on the Disk. The amount of reserved plots is included in the assessment
func (PlotInfo) PlotsStored ¶
PlotsStored calculates the amount of plots which are stored on the Disk. The amount of reserved plots is not included in the assessment
func (PlotInfo) PlotsTotal ¶
PlotsTotal calculates the total amount of plots which can be stored on the Disk. The amount of reserved plots is not included in the assessment
type Space ¶
type Space uint64
Space represents disk space in bytes
const SizeOfPlot Space = 108770046772
SizeOfPlot in Bytes A k32 will take up 101.3 GiB of space once completed 101.3 * 1024 * 1024 * 1024 = 108770046771,2