Versions in this module Expand all Collapse all v0 v0.2.2 Jan 15, 2025 Changes in this version + const ZdbVolume + var ErrDeviceAlreadyMounted = fmt.Errorf("device is already mounted") + var ErrDeviceNotMounted = fmt.Errorf("device is not mounted") + func All(Pool) bool + func BindMount(src Volume, target string) error + func FilesUsage(path string) (uint64, error) + func GetMountTarget(device string) (string, bool) + func IsMountPoint(path string) bool + func Partprobe(ctx context.Context) error + type Btrfs struct + Devices []BtrfsDevice + Label string + TotalDevices int + UUID string + Used int64 + Warnings string + type BtrfsDevice struct + DevID int + Missing bool + Path string + Size int64 + Used int64 + type BtrfsDiskUsage struct + Data DiskUsage + GlobalReserve DiskUsage + Metadata DiskUsage + System DiskUsage + type BtrfsQGroup struct + Excl uint64 + ID string + MaxExcl uint64 + MaxRfer uint64 + Rfer uint64 + type BtrfsUtil struct + func NewUtils() BtrfsUtil + func (u *BtrfsUtil) DeviceAdd(ctx context.Context, dev string, root string) error + func (u *BtrfsUtil) DeviceRemove(ctx context.Context, dev string, root string) error + func (u *BtrfsUtil) GetDiskUsage(ctx context.Context, path string) (usage BtrfsDiskUsage, err error) + func (u *BtrfsUtil) List(ctx context.Context, label string, mounted bool) ([]Btrfs, error) + func (u *BtrfsUtil) QGroupDestroy(ctx context.Context, id, path string) error + func (u *BtrfsUtil) QGroupEnable(ctx context.Context, root string) error + func (u *BtrfsUtil) QGroupLimit(ctx context.Context, size uint64, path string) error + func (u *BtrfsUtil) QGroupList(ctx context.Context, path string) (map[string]BtrfsQGroup, error) + func (u *BtrfsUtil) SubvolumeAdd(ctx context.Context, root string) error + func (u *BtrfsUtil) SubvolumeInfo(ctx context.Context, path string) (volume BtrfsVolume, err error) + func (u *BtrfsUtil) SubvolumeList(ctx context.Context, root string) ([]BtrfsVolume, error) + func (u *BtrfsUtil) SubvolumeRemove(ctx context.Context, root string) error + type BtrfsVolume struct + Generation int + ID int + ParentID int + Path string + type DeviceInfo struct + Children []DeviceInfo + Filesystem FSType + Label string + Path string + Rota bool + Size uint64 + Subsystems string + UUID string + func (d *DeviceInfo) AllocateEmptySpace(ctx context.Context, space DiskSpace) error + func (d *DeviceInfo) DetectType() (zos.DeviceType, error) + func (d *DeviceInfo) GetUnallocatedSpaces(ctx context.Context) ([]DiskSpace, error) + func (d *DeviceInfo) IsPXEPartition() bool + func (d *DeviceInfo) IsPartitioned() bool + func (d *DeviceInfo) Mountpoint(ctx context.Context) (string, error) + func (d *DeviceInfo) RefreshDeviceInfo(ctx context.Context) (DeviceInfo, error) + func (i *DeviceInfo) Name() string + func (i *DeviceInfo) Used() bool + type DeviceManager interface + ByLabel func(ctx context.Context, label string) (Devices, error) + ClearCache func() + Device func(ctx context.Context, device string) (DeviceInfo, error) + Devices func(ctx context.Context) (Devices, error) + Mountpoint func(ctx context.Context, device string) (string, error) + Seektime func(ctx context.Context, device string) (zos.DeviceType, error) + func DefaultDeviceManager() DeviceManager + type Devices []DeviceInfo + type DiskSpace struct + End string + Number int + Size string + Start string + Type string + type DiskUsage struct + Total uint64 + Used uint64 + type FSType string + const BtrfsFSType + type Filter func(pool Pool) bool + type Pool interface + AddVolume func(name string) (Volume, error) + Device func() DeviceInfo + Mount func() (string, error) + Mounted func() (string, error) + RemoveVolume func(name string) error + SetType func(typ zos.DeviceType) error + Shutdown func() error + Type func() (zos.DeviceType, bool, error) + UnMount func() error + Volumes func() ([]Volume, error) + func NewBtrfsPool(device DeviceInfo) (Pool, error) + type Usage struct + Excl uint64 + Size uint64 + Used uint64 + type Volume interface + FsType func() string + ID func() int + Limit func(size uint64) error + Name func() string + Path func() string + Usage func() (Usage, error)