Skip to main content

Module fs

Module fs 

Source
Expand description

Filesystem endpoints.

Every path in here reaches the disk through FsRoot and by no other route. The handlers hold no path logic of their own — that separation is what makes the jail auditable by reading one file.

Re-exports§

pub use crate::fs::UPLOAD_DIR;

Structs§

CreateUpload
Body of POST /api/v1/fs/uploads.
FsEntry
One filesystem entry, as reported by stat and by each list item.
ListQuery
Query parameters for list.
ListResponse
One page of entries.
PathQuery
Query parameters shared by the single-path endpoints.
UploadState
Reply describing a session’s current state.

Enums§

RangeOutcome
The outcome of interpreting a Range header against a file of size bytes.

Constants§

DEFAULT_LIST_LIMIT
Default page size for list.
MAX_LIST_LIMIT
Largest page a caller may ask for. Requests above it are clamped, not refused.

Functions§

append_chunk
PATCH /api/v1/fs/uploads/{id} — append one chunk.
cancel_upload
DELETE /api/v1/fs/uploads/{id} — abandon a session.
complete_upload
POST /api/v1/fs/uploads/{id}/complete — verify and publish.
create_upload
POST /api/v1/fs/uploads — open a session.
delete_file
DELETE /api/v1/fs/file — remove one named entry.
download
GET /api/v1/fs/file — the whole file, or a range of it.
entry_for
Build an entry for one already-resolved path.
error_response
Render a refusal as JSON with a machine-readable code.
etag_for
A validator that changes whenever the bytes at a path might have changed.
fs_error_response
Map a jail refusal onto HTTP.
fs_not_enabled
The refusal sent when no --fs-root was configured.
list
GET /api/v1/fs/list — one page of a directory’s contents.
mtime_ms
Milliseconds since the Unix epoch, or zero when the clock says otherwise.
parse_content_range_start
The start offset named by a Content-Range request header.
parse_range
Parse a single-range Range header against a file of size bytes.
stat
GET /api/v1/fs/stat — one entry, file or directory.
sweep_expired_uploads
Drop upload sessions idle past ttl, recording a terminal event for each.
sweep_orphaned_uploads
Remove .part staging files left behind by a previous run, recording a terminal event for each.
upload_status
GET /api/v1/fs/uploads/{id} — where to resume from.