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 ¶
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.
Directories
¶
| Path | Synopsis |
|---|---|
|
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. |
Click to show internal directories.
Click to hide internal directories.