repository::[−][src] backend:: common:: generic_flatfile
FlatFile’s are structured as an initial header, followed by an append
only log of ‘entries’.
The initial header contains three components:
The magic number identifying asuran
FlatFiles is the 8-byte string
Length of header
The total length of the encrypted key, in bytes, as a u16.
The serialized, encrypted key material for this repository.
The first byte of the first entry immediately follows the last byte of the initial header
An entry is composed of three parts:
The header is a sequence of three u16s, each indicating the major, minor, and patch version of the version of asuran to last write to the file. This is then followed by the 16-byte implementation UUID. This is then followed by two
u64s, the first being the location of the footer, and the second being the location of the next header. The location of the next header will be beyond the end of the file if you are reading the last entry in a file.
The body is a length of concatenated raw chunk bodies, and does not contain any structure beyond being a list of bytes.
The footer contains two parts, a
u64describing the length of the following
Chunk, then the serialized
EntryFooterDatastruct, wrapped and encrypted/compressed in a
FlatFile repositories are always terminated with an
EntryHeader with the
next_header_offset set to 0. This is intended to be
overridden during the next writing session.
A view over a generic