table

package
v0.0.0-...-9c77b49 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2018 License: MPL-2.0 Imports: 1 Imported by: 0

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
	// 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