probe

package
v2.0.0-...-3265299 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2024 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package probe defines common probe interfaces.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MagicMatch

type MagicMatch struct {
	Prober Prober
	Magic  magic.Magic
}

MagicMatch is a magic detection result.

type Partition

type Partition struct {
	UUID     *uuid.UUID
	TypeUUID *uuid.UUID
	Label    *string

	Index uint // 1-based index

	Offset uint64
	Size   uint64
}

Partition is a probe sub-result.

type Prober

type Prober interface {
	// Name returns the name of the filesystem or volume manager.
	Name() string
	// Magic returns the magic value for the filesystem or volume manager.
	Magic() []*magic.Magic
	// Probe runs the further inspection and returns the result if successful.
	Probe(Reader, magic.Magic) (*Result, error)
}

Prober is an interface for probing filesystems and volume managers.

type Reader

type Reader interface {
	io.ReaderAt

	GetSectorSize() uint
	GetSize() uint64
}

Reader is a context for probing filesystems and volume managers.

type Result

type Result struct {
	UUID  *uuid.UUID
	Label *string

	Parts []Partition

	BlockSize           uint32
	FilesystemBlockSize uint32
	ProbedSize          uint64
}

Result is a probe result.

Jump to

Keyboard shortcuts

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