probe

package
v0.1.1-0...-42241d0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 22, 2021 License: MPL-2.0 Imports: 7 Imported by: 0

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.

func GetBlockDeviceWithPartitionName

func GetBlockDeviceWithPartitionName(name string) (bd *blockdevice.BlockDevice, err error)

GetBlockDeviceWithPartitionName probes all known block device's partition table for a parition with the specified name.

func GetPartitionWithName

func GetPartitionWithName(name string) (f *os.File, err error)

GetPartitionWithName probes all known block device's partition table for a parition with the specified name.

nolint: gocyclo

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) (all []*ProbedBlockDevice, err error)

All probes a block device's file system for the given label.

type SelectOption

type SelectOption func(device *ProbedBlockDevice) (bool, error)

SelectOption is a callback matcher for All block devices probes.

func WithPartitionLabel

func WithPartitionLabel(label string) SelectOption

WithPartitionLabel search for a block device which has partitions with some specific label.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL