Documentation
¶
Overview ¶
Package format defines the durable, versioned container format shared by compactfs metadata, chunk references, and every export protocol.
Index ¶
Constants ¶
const ( // Magic identifies the volume-format record stored in metadata. Magic = "CFSFRM01" // CurrentVersion is the only volume-format schema this package writes. CurrentVersion = uint16(2) // CodecRegistryVersion freezes the codec-name mapping used by chunk refs. CodecRegistryVersion = uint16(3) )
Variables ¶
Functions ¶
This section is empty.
Types ¶
type Volume ¶
type Volume struct {
Version uint16
CodecRegistry uint16
// ChunkSize is the raw maximum of every non-final chunk and the indexing
// unit used by file manifests. Reopening with another value would reinterpret
// file offsets, so it is fixed when the volume is created.
ChunkSize uint64
// Chunking and CDC bounds select backend subdivision inside each fixed
// raw addressing window. This policy is immutable for the volume.
Chunking string
ChunkMin uint64
ChunkAvg uint64
ChunkMax uint64
// HashAlgorithm names the raw-content address used by backend object keys.
HashAlgorithm string
// Features is reserved for backward-compatible, format-defined flags. A
// reader must reject flags it does not understand.
Features uint64
}
Volume is the immutable structural identity of a compactfs volume. It does not select one encoder for the whole volume: each chunk ref stores its wire codec from the frozen registry identified by CodecRegistry.
func (Volume) MarshalBinary ¶
MarshalBinary returns the self-identifying record stored in metadata. The containing metadata transaction supplies durability and checksum; this body has fixed integer fields and only one length-prefixed string.
func (*Volume) UnmarshalBinary ¶
UnmarshalBinary validates magic, schema, hash name, and trailing bytes.