Documentation
¶
Index ¶
- func GetPartitionDeviceByLabel(s *sys.System, b Device, label string, attempts int) (string, error)
- type Device
- type Partition
- func GetPartitionByLabel(s *sys.System, b Device, label string, attempts int) (*Partition, error)
- func GetPartitionByMountPoint(s *sys.System, b Device, mountpoint string, attempts int) (*Partition, error)
- func GetPartitionByUUID(s *sys.System, b Device, uuid string, attempts int) (*Partition, error)
- type PartitionList
- func (pl PartitionList) GetByLabel(label string) *Partition
- func (pl PartitionList) GetByMountPoint(mountpoint string) *Partition
- func (pl PartitionList) GetByName(name string) *Partition
- func (pl PartitionList) GetByUUID(uuid string) *Partition
- func (pl PartitionList) GetByUUIDNameOrLabel(uuid, name, label string) *Partition
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetPartitionDeviceByLabel ¶
GetPartitionDeviceByLabel will try to return the device that matches the given label. attempts value sets the number of attempts to find the device, it waits a second between attempts.
Types ¶
type Partition ¶
type Partition struct {
Name string
Label string
Size uint
FileSystem string
UUID string
Flags []string
MountPoints []string
Path string
Disk string
}
Partition struct represents a partition with its commonly configurable values, size in MiB
func GetPartitionByLabel ¶
GetPartitionByLabel tries to return the partition that matches the given label. attempts value sets the number of attempts to find the device, it waits a second between attempts.
func GetPartitionByMountPoint ¶
func GetPartitionByMountPoint(s *sys.System, b Device, mountpoint string, attempts int) (*Partition, error)
GetPartitionByMountPoint tries to return the partition that is mounted in the given mount point. attempts value sets the number of attempts to find the device, it waits a second between attempts.
func GetPartitionByUUID ¶
GetPartitionByUUID tries to return the partition that matches the given filesystem UUID. attempts value sets the number of attempts to find the device, it waits a second between attempts.
type PartitionList ¶
type PartitionList []*Partition
func (PartitionList) GetByLabel ¶
func (pl PartitionList) GetByLabel(label string) *Partition
GetByLabel gets a partition by its label from the PartitionList
func (PartitionList) GetByMountPoint ¶
func (pl PartitionList) GetByMountPoint(mountpoint string) *Partition
GetByMountPoint gets a partition by its mountpoint from the PartitionList.
func (PartitionList) GetByName ¶
func (pl PartitionList) GetByName(name string) *Partition
GetByName gets a partitions by its name from the PartitionList
func (PartitionList) GetByUUID ¶
func (pl PartitionList) GetByUUID(uuid string) *Partition
GetByUUID gets a partition by its filesystem UUID from the PartitionList
func (PartitionList) GetByUUIDNameOrLabel ¶
func (pl PartitionList) GetByUUIDNameOrLabel(uuid, name, label string) *Partition
GetByNameOrLabel gets a partition by its uuid, name or label. It tries by uuid first and label as the option.