Documentation ¶
Overview ¶
Package probe provides functions for probing block devices for things such as filesystems, and partions.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DevForPartitionLabel ¶
func DevForPartitionLabel(devname, label string) (*blockdevice.BlockDevice, error)
DevForPartitionLabel finds and opens partition as a blockdevice.
Types ¶
type ProbedBlockDevice ¶
type ProbedBlockDevice struct { *blockdevice.BlockDevice SuperBlock filesystem.SuperBlocker Path string }
ProbedBlockDevice represents a probed block device.
func All ¶
func All(options ...SelectOption) ([]*ProbedBlockDevice, error)
All probes a block device's file system for the given label.
func GetDevWithFileSystemLabel ¶
func GetDevWithFileSystemLabel(value string) (*ProbedBlockDevice, error)
GetDevWithFileSystemLabel probes all known block device's file systems for the given label.
func GetDevWithPartitionName ¶
func GetDevWithPartitionName(name string) (*ProbedBlockDevice, error)
GetDevWithPartitionName probes all known block device's partition table for a parition with the specified name.
type SelectOption ¶
type SelectOption func(device *ProbedBlockDevice) (bool, error)
SelectOption is a callback matcher for All block devices probes.
func WithFileSystemLabel ¶
func WithFileSystemLabel(label string) SelectOption
WithFileSystemLabel searches for a block device which has filesystem labeled with the provided label.
func WithPartitionLabel ¶
func WithPartitionLabel(label string) SelectOption
WithPartitionLabel search for a block device which has partitions with some specific label.
func WithSingleResult ¶
func WithSingleResult() SelectOption
WithSingleResult enforces a single result from All function.