table

package
v0.1.0-alpha.20 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2019 License: MPL-2.0 Imports: 1 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package table provides a library for working with block device partition tables.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Header interface {
	// Bytes returns the partition table header as a byte slice.
	Bytes() []byte
	serde.Serde
}

Header describes a partition table header.

type Partition

type Partition interface {
	// Bytes returns the partition table partitions as a byte slice.
	Bytes() []byte
	// Start returns the partition's starting LBA.
	Start() int64
	// Length returns the partition's length in LBA.
	Length() int64
	// No returns the partition's number.
	No() int32
	serde.Serde
}

Partition describes a partition.

type PartitionTable

type PartitionTable interface {
	// Bytes returns the partition table as a byte slice.
	Bytes() Table
	// Read reades the partition table.
	Read() error
	// Write writes the partition table/.
	Write() error
	// Type returns the partition table type.
	Type() Type
	// Header returns the partition table header.
	Header() Header
	// Partitions returns a slice o partition table partitions.
	Partitions() []Partition
	// Repair repairs a partition table.
	Repair() error
	// New creates a new partition table.
	New() (PartitionTable, error)
	// Partitioner must be implemented by a partition table.
	Partitioner
}

PartitionTable describes a partition table.

type Partitioner

type Partitioner interface {
	// Add adds a partition to the partition table.
	Add(uint64, ...interface{}) (Partition, error)
	// Resize resizes a partition table.
	Resize(Partition) error
	// Delete deletes a partition table.
	Delete(Partition) error
}

Partitioner describes actions that can be taken on a partition.

type Table

type Table = []byte

Table represents a partition table.

type Type

type Type int

Type represents a partition table type.

const (
	// MBR is the Master Boot Record artition table.
	MBR Type = iota
	// GPT is the GUID partition table.
	GPT
)

Directories

Path Synopsis
gpt
Package gpt provides a library for working with GPT partitions.
Package gpt provides a library for working with GPT partitions.
header
Package header provides a library for working with GPT headers.
Package header provides a library for working with GPT headers.
partition
Package partition provides a library for working with GPT partitions.
Package partition provides a library for working with GPT partitions.

Jump to

Keyboard shortcuts

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