Expand description
Transfer metadata: file info, chunk plans and ETags.
These structures are serialized to JSON and exchanged through
HEADER_FILE_META and the transfer
manifest so that server and client agree on chunk boundaries and can
validate resume offsets.
Structs§
- Chunk
Meta - One chunk of a file transfer.
- Chunk
Range - A contiguous byte range of a file:
[start, end). - File
Meta - Metadata about a single file involved in a transfer.
- Transfer
Plan - The full transfer plan for one file: chunk layout derived from size.
Functions§
- base64_
decode - Base64-decode
input(standard alphabet,=/whitespace tolerated). - base64_
encode - Base64-encode
input(standard alphabet,=padding). - decode_
file_ meta - Parse
FileMetafrom the [HEADER_FILE_META] header. - decode_
file_ meta_ header - Decode
FileMetafrom the [HEADER_FILE_META] header. - encode_
file_ meta - Serialize
FileMetafor the [HEADER_FILE_META] header. - encode_
file_ meta_ header - Encode
FileMetafor the [HEADER_FILE_META] header. - etag_
from_ size_ mtime - Compute a deterministic, content-independent ETag from size + mtime.
- hex
- Hex-encode a byte slice (lowercase, no prefix).